diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-08 16:06:38 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-08 16:06:38 +0100 |
commit | 519a99ab7f5d6a20d985fa0b515567d43c4c802a (patch) | |
tree | d19f78285bfc023f8aae942d9017384a25b7b548 /tests/pos/desugar.scala | |
parent | b5be3e97d5e2455966f170b7cd0baba82c8fae12 (diff) | |
download | dotty-519a99ab7f5d6a20d985fa0b515567d43c4c802a.tar.gz dotty-519a99ab7f5d6a20d985fa0b515567d43c4c802a.tar.bz2 dotty-519a99ab7f5d6a20d985fa0b515567d43c4c802a.zip |
Fixes to desugaring of for-expressions with embedded aliases.
Diffstat (limited to 'tests/pos/desugar.scala')
-rw-r--r-- | tests/pos/desugar.scala | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/tests/pos/desugar.scala b/tests/pos/desugar.scala index 7a12de373..69e8c8651 100644 --- a/tests/pos/desugar.scala +++ b/tests/pos/desugar.scala @@ -1,9 +1,9 @@ object desugar { - + // variables var x: Int = 2 var y = x * x - + { var z: Int = y } def foo0(first: Int, second: Int = 2, third: Int = 3) = first + second @@ -24,11 +24,11 @@ object desugar { case object Nil extends List[Nothing] } - - import caseClasses._ - + object patDefs { + import caseClasses._ + val xs: List[Int] = Cons(1, Cons(2, Nil)) val Cons(y, ys) = xs @@ -39,4 +39,21 @@ object desugar { val x, y, z: Int = 1 } + + object Binops { + + x :: y :: Nil + + } + + object fors { + + for (x <- List(1, 2, 3)) yield 2 + for (x <- List(1, 2, 3) if x % 2 == 0) yield x * x + for (x <- List(1, 2, 3); y <- 0 to x) yield x * y + for (x <- List(1, 2, 3); y <- 0 to x; if x + y % 2 == 0) yield x * y + for (x <- List(1, 2, 3); y = x * x; if x + y % 2 == 0) yield x * y + for (x <- List(1, 2, 3); y = x * x; z = x * y; u <- 0 to y) yield x * y * z * u + } + }
\ No newline at end of file |