diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-10 00:55:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-10 00:55:15 +0000 |
commit | 879e5af47db2ae6807aef26dd786e6ea920ac554 (patch) | |
tree | 7aecb05e2c9361689c16dec2a2c8473af6d0b4fd /test/files/run/forvaleq.scala | |
parent | e3e64e43659f53dd8f9cd5837f78a7e4378dc4c4 (diff) | |
download | scala-879e5af47db2ae6807aef26dd786e6ea920ac554.tar.gz scala-879e5af47db2ae6807aef26dd786e6ea920ac554.tar.bz2 scala-879e5af47db2ae6807aef26dd786e6ea920ac554.zip |
Reversed the values of "is" and "is not" in rec...
Reversed the values of "is" and "is not" in recent for comprehension
deprecation.
DO NOT BLOW HATCH
REPEAT
DO NOT BLOW HATCH
"Roger! Hatch blown."
Events reveal it was all baby, no bathwater. It turns out that the
specification is merely a document, not infallible holy writ as we
had all previously believed. So it is not the ABSENCE of val in a for
comprehension assignment which is deprecated, it is the PRESENCE of val.
Summarizing again, more accurately perhaps:
for (x <- 1 to 5 ; y = x) yield x+y // THAT's the one
for (val x <- 1 to 5 ; y = x) yield x+y // fail
for (val x <- 1 to 5 ; val y = x) yield x+y // fail
for (x <- 1 to 5 ; val y = x) yield x+y // deprecated
No review.
Diffstat (limited to 'test/files/run/forvaleq.scala')
-rw-r--r-- | test/files/run/forvaleq.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/files/run/forvaleq.scala b/test/files/run/forvaleq.scala index 40dbfd099a..8c1824a769 100644 --- a/test/files/run/forvaleq.scala +++ b/test/files/run/forvaleq.scala @@ -24,7 +24,7 @@ object Test { val input = L.range(0,20) val oddFirstTimesTwo = for {x <- input - val xf = firstDigit(x) + xf = firstDigit(x) if xf % 2 == 1} yield x*2 println(oddFirstTimesTwo) @@ -36,9 +36,9 @@ object Test { val input = L.range(0, 20) val oddFirstTimesTwo = for {x <- input - val xf = firstDigit(x) - val yf = x - firstDigit(x) / 10 - val (a, b) = (xf - yf, xf + yf) + xf = firstDigit(x) + yf = x - firstDigit(x) / 10 + (a, b) = (xf - yf, xf + yf) if xf % 2 == 1} yield a + b println(oddFirstTimesTwo) @@ -51,7 +51,7 @@ object Test { val input = L.range(0, 20).iterator val oddFirstTimesTwo = for {x <- input - val xf = firstDigit(x) + xf = firstDigit(x) if xf % 2 == 1} yield x*2 println(oddFirstTimesTwo.toList) @@ -63,7 +63,7 @@ object Test { val input = L.range(0,20) val oddFirstTimesTwo = for {x <- input - val xf = firstDigit(x) + xf = firstDigit(x) if xf % 2 == 1} yield xf*2 println(oddFirstTimesTwo) @@ -80,7 +80,7 @@ object Test { val input = L.range(0,20) for {x <- input - val xf = fdct(x) + xf = fdct(x) if xf % 2 == 1} yield xf |