diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-12-01 15:40:33 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-12-16 13:15:01 +0100 |
commit | f78ef2ca72a1b70db98fa9f6a44bf81d33f3ff28 (patch) | |
tree | e3a734f405964f39d8cf8d38fd2f72264f868178 /tests/pos/Labels.scala | |
parent | 3943aa8359b1e8f5109a616504b8677232ae78c5 (diff) | |
download | dotty-f78ef2ca72a1b70db98fa9f6a44bf81d33f3ff28.tar.gz dotty-f78ef2ca72a1b70db98fa9f6a44bf81d33f3ff28.tar.bz2 dotty-f78ef2ca72a1b70db98fa9f6a44bf81d33f3ff28.zip |
Label test with nested cycles and simple patterns.
Diffstat (limited to 'tests/pos/Labels.scala')
-rw-r--r-- | tests/pos/Labels.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/pos/Labels.scala b/tests/pos/Labels.scala new file mode 100644 index 000000000..4a84175af --- /dev/null +++ b/tests/pos/Labels.scala @@ -0,0 +1,21 @@ +object Labels { + def main(args: Array[String]): Unit = { + var i = 10 + while(i>0) { + var j = 0 + while(j<i) { + println(j+" " + i) + j = j +1 + } + i = i - 1} + pattern(1) + pattern(2) + pattern(3) + } + + def pattern(a: Int) = a match { + case 1 if (a>0) => println("one") + case t@2 => println("two" + t) + case _ => println("default") + } +} |