Skip to content

Commit cb5724e

Browse files
paulpadriaanm
authored andcommitted
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.
1 parent 7f53a7a commit cb5724e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/files/run/fors.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ object Test extends App {
7676
for {x <- it
7777
if x % 2 == 0} print(x + " "); println
7878
for (x <- it;
79-
val y = 2
79+
y = 2
8080
if x % y == 0) print(x + " "); println
8181
for {x <- it
82-
val y = 2
82+
y = 2
8383
if x % y == 0} print(x + " "); println
8484

8585
// arrays

0 commit comments

Comments
 (0)