diff options
Diffstat (limited to 'tests/untried/neg/for-comprehension-old.scala')
-rw-r--r-- | tests/untried/neg/for-comprehension-old.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/untried/neg/for-comprehension-old.scala b/tests/untried/neg/for-comprehension-old.scala new file mode 100644 index 000000000..10ae363bd --- /dev/null +++ b/tests/untried/neg/for-comprehension-old.scala @@ -0,0 +1,11 @@ +class A { + 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 // 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 +} |