File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ class tests extends CompilerTest {
127
127
@ Test def tools_io = compileDir(dotcDir + " tools/io" , twice)
128
128
129
129
@ Test def helloWorld = compileFile(posDir, " HelloWorld" , doEmitBytecode)
130
+ @ Test def labels = compileFile(posDir, " Labels" , doEmitBytecode)
130
131
// @Test def tools = compileDir(dotcDir + "tools", "-deep" :: Nil)(allowDeepSubtypes)
131
132
132
133
@ Test def testNonCyclic = compileArgs(Array (
Original file line number Diff line number Diff line change
1
+ object Labels {
2
+ def main (args : Array [String ]): Unit = {
3
+ var i = 10
4
+ while (i> 0 ) {
5
+ var j = 0
6
+ while (j< i) {
7
+ println(j+ " " + i)
8
+ j = j + 1
9
+ }
10
+ i = i - 1 }
11
+ pattern(1 )
12
+ pattern(2 )
13
+ pattern(3 )
14
+ }
15
+
16
+ def pattern (a : Int ) = a match {
17
+ case 1 if (a> 0 ) => println(" one" )
18
+ case t@ 2 => println(" two" + t)
19
+ case _ => println(" default" )
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments