summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-10 00:55:15 +0000
committerPaul Phillips <paulp@improving.org>2011-08-10 00:55:15 +0000
commit879e5af47db2ae6807aef26dd786e6ea920ac554 (patch)
tree7aecb05e2c9361689c16dec2a2c8473af6d0b4fd /test/files/neg
parente3e64e43659f53dd8f9cd5837f78a7e4378dc4c4 (diff)
downloadscala-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/neg')
-rw-r--r--test/files/neg/for-comprehension-old.check24
-rw-r--r--test/files/neg/for-comprehension-old.scala8
-rw-r--r--test/files/neg/t4163.check6
-rw-r--r--test/files/neg/t4163.scala10
4 files changed, 24 insertions, 24 deletions
diff --git a/test/files/neg/for-comprehension-old.check b/test/files/neg/for-comprehension-old.check
index 783354d233..1ecaf12af4 100644
--- a/test/files/neg/for-comprehension-old.check
+++ b/test/files/neg/for-comprehension-old.check
@@ -1,15 +1,15 @@
-for-comprehension-old.scala:2: warning: for comprehension assignment without a `val' declaration is deprecated.
- for (x <- 1 to 5 ; y = x) yield x+y // fail
- ^
-for-comprehension-old.scala:4: warning: for comprehension assignment without a `val' declaration is deprecated.
- for (val x <- 1 to 5 ; y = x) yield x+y // fail
- ^
-for-comprehension-old.scala:7: warning: for comprehension assignment without a `val' declaration is deprecated.
- for (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x+y // fail
- ^
-for-comprehension-old.scala:9: warning: for comprehension assignment without a `val' declaration is deprecated.
- for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail
- ^
+for-comprehension-old.scala:3: warning: val keyword in for comprehension is deprecated
+ for (x <- 1 to 5 ; val y = x) yield x+y // fail
+ ^
+for-comprehension-old.scala:5: warning: val keyword in for comprehension is deprecated
+ for (val x <- 1 to 5 ; val y = x) yield x+y // fail
+ ^
+for-comprehension-old.scala:8: warning: val keyword in for comprehension is deprecated
+ for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // fail
+ ^
+for-comprehension-old.scala:10: warning: val keyword in for comprehension is deprecated
+ for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail
+ ^
for-comprehension-old.scala:4: error: val in for comprehension must be followed by assignment
for (val x <- 1 to 5 ; y = x) yield x+y // fail
^
diff --git a/test/files/neg/for-comprehension-old.scala b/test/files/neg/for-comprehension-old.scala
index 476e99808e..10ae363bde 100644
--- a/test/files/neg/for-comprehension-old.scala
+++ b/test/files/neg/for-comprehension-old.scala
@@ -1,11 +1,11 @@
class A {
- for (x <- 1 to 5 ; y = x) yield x+y // fail
- for (x <- 1 to 5 ; val y = x) yield x+y // ok
+ for (x <- 1 to 5 ; y = x) yield x+y // ok
+ for (x <- 1 to 5 ; val y = x) yield x+y // fail
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 (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x+y // fail
- for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // ok
+ for (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x+y // ok
+ for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // fail
for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail
for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail
}
diff --git a/test/files/neg/t4163.check b/test/files/neg/t4163.check
index e94c4fae7c..47bc78d31c 100644
--- a/test/files/neg/t4163.check
+++ b/test/files/neg/t4163.check
@@ -1,7 +1,7 @@
t4163.scala:4: error: '<-' expected but '=' found.
- val x = 3
- ^
+ x = 3
+ ^
t4163.scala:5: error: illegal start of simple expression
- y <- 0 to 100
+ y <- 0 to 100
^
two errors found
diff --git a/test/files/neg/t4163.scala b/test/files/neg/t4163.scala
index bb4c65f18d..44686731d1 100644
--- a/test/files/neg/t4163.scala
+++ b/test/files/neg/t4163.scala
@@ -1,8 +1,8 @@
class Bug {
val z = (
- for {
- val x = 3
- y <- 0 to 100
- } yield y
- ).toArray
+ for {
+ x = 3
+ y <- 0 to 100
+ } yield y
+ ).toArray
}