diff options
Diffstat (limited to 'test/files/run/t5830.scala')
-rw-r--r-- | test/files/run/t5830.scala | 13 |
1 files changed, 6 insertions, 7 deletions
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' |