diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5830.check | 1 | ||||
-rw-r--r-- | test/files/run/t5830.scala | 13 | ||||
-rw-r--r-- | test/files/run/t6011c.scala | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/test/files/run/t5830.check b/test/files/run/t5830.check index 675387eb8e..9260854676 100644 --- a/test/files/run/t5830.check +++ b/test/files/run/t5830.check @@ -1,5 +1,6 @@ a with oef a with oef +a with oef a def with oef def diff --git a/test/files/run/t5830.scala b/test/files/run/t5830.scala index 5d808bfa28..03b9c540e0 100644 --- a/test/files/run/t5830.scala +++ b/test/files/run/t5830.scala @@ -1,12 +1,11 @@ import scala.annotation.switch object Test extends App { - // TODO: should not emit a switch - // def noSwitch(ch: Char, eof: Boolean) = (ch: @switch) match { - // case 'a' if eof => println("a with oef") // then branch - // } + def noSwitch(ch: Char, eof: Boolean) = ch match { + case 'a' if eof => println("a with oef") // then branch + } - def onlyThen(ch: Char, eof: Boolean) = (ch: @switch) match { + def onlyThen(ch: Char, eof: Boolean) = ch match { case 'a' if eof => println("a with oef") // then branch case 'c' => } @@ -18,7 +17,7 @@ object Test extends App { case 'c' => } - def defaultUnguarded(ch: Char, eof: Boolean) = (ch: @switch) match { + def defaultUnguarded(ch: Char, eof: Boolean) = ch match { case ' ' if eof => println("spacey oef") case _ => println("default") } @@ -44,7 +43,7 @@ object Test extends App { // case 'c' => // } - // noSwitch('a', true) + noSwitch('a', true) onlyThen('a', true) // 'a with oef' ifThenElse('a', true) // 'a with oef' ifThenElse('a', false) // 'a' diff --git a/test/files/run/t6011c.scala b/test/files/run/t6011c.scala index 0647e3f81a..96a685b9cf 100644 --- a/test/files/run/t6011c.scala +++ b/test/files/run/t6011c.scala @@ -6,7 +6,7 @@ object Test extends App { // at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:50) // at scala.tools.nsc.Global.abort(Global.scala:249) // at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder$jcode$.emitSWITCH(GenASM.scala:1850) - ((1: Byte): @unchecked @annotation.switch) match { + ((1: Byte): @unchecked) match { case 1 => 2 case 1 => 3 // crash } |