diff options
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") + } +} |