diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-08 06:56:21 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-08 06:56:21 +0000 |
commit | 8b28292b5379a34fad0599335116b9e54ee44e20 (patch) | |
tree | 654c93a14a26e802948aa80664efb7aea7b448d3 /test/files/neg | |
parent | be31934db38a93468b6390e783ca377da6283c19 (diff) | |
download | scala-8b28292b5379a34fad0599335116b9e54ee44e20.tar.gz scala-8b28292b5379a34fad0599335116b9e54ee44e20.tar.bz2 scala-8b28292b5379a34fad0599335116b9e54ee44e20.zip |
Fixing all the tests and source which still use...
Fixing all the tests and source which still use the old for
comprehension syntax with vals where there are no vals and no vals where
there are vals. No review.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/for-comprehension-old.check | 25 | ||||
-rw-r--r-- | test/files/neg/for-comprehension-old.scala | 11 | ||||
-rw-r--r-- | test/files/neg/t4163.check | 4 | ||||
-rw-r--r-- | test/files/neg/t4163.scala | 2 |
4 files changed, 39 insertions, 3 deletions
diff --git a/test/files/neg/for-comprehension-old.check b/test/files/neg/for-comprehension-old.check new file mode 100644 index 0000000000..ec54d619b4 --- /dev/null +++ b/test/files/neg/for-comprehension-old.check @@ -0,0 +1,25 @@ +for-comprehension-old.scala:2: error: assignment in for comprehension must be preceded by `val` + for (x <- 1 to 5 ; 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 + ^ +for-comprehension-old.scala:4: error: assignment in for comprehension must be preceded by `val` + for (val x <- 1 to 5 ; y = x) yield x+y // fail + ^ +for-comprehension-old.scala:5: error: val in for comprehension must be followed by assignment + for (val x <- 1 to 5 ; val y = x) yield x+y // fail + ^ +for-comprehension-old.scala:7: error: assignment in for comprehension must be preceded by `val` + for (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x+y // fail + ^ +for-comprehension-old.scala:9: error: val in for comprehension must be followed by assignment + for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail + ^ +for-comprehension-old.scala:9: error: assignment in for comprehension must be preceded by `val` + for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail + ^ +for-comprehension-old.scala:10: error: val in for comprehension must be followed by assignment + for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail + ^ +8 errors found diff --git a/test/files/neg/for-comprehension-old.scala b/test/files/neg/for-comprehension-old.scala new file mode 100644 index 0000000000..476e99808e --- /dev/null +++ b/test/files/neg/for-comprehension-old.scala @@ -0,0 +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 (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 ; 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 d275117833..e94c4fae7c 100644 --- a/test/files/neg/t4163.check +++ b/test/files/neg/t4163.check @@ -1,6 +1,6 @@ t4163.scala:4: error: '<-' expected but '=' found. - x = 3 - ^ + val x = 3 + ^ t4163.scala:5: error: illegal start of simple expression y <- 0 to 100 ^ diff --git a/test/files/neg/t4163.scala b/test/files/neg/t4163.scala index 25ce5522a4..bb4c65f18d 100644 --- a/test/files/neg/t4163.scala +++ b/test/files/neg/t4163.scala @@ -1,7 +1,7 @@ class Bug { val z = ( for { - x = 3 + val x = 3 y <- 0 to 100 } yield y ).toArray |