aboutsummaryrefslogblamecommitdiff
path: root/tests/untried/neg/for-comprehension-old.scala
blob: 270861751c5d6c0da577bcbd3ee1801bf76b9807 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
         



                                                         
 



                                                                       
 
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
}