Permalink
Browse files

don't error when not emitting required switch

we don't handle switches with guards, whereas the old patmat did
to ease the transition, let's not error out and see how we can resolve this
  • Loading branch information...
1 parent 032e8ae commit aee338da477bbe6e059f8ed3ae231e5e51128d93 @adriaanm adriaanm committed May 24, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
  2. +1 −0 test/files/neg/switch.flags
@@ -1105,7 +1105,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
}
emitSwitch(scrut, scrutSym, casesNoSubstOnly, pt, matchFailGenOverride).getOrElse{
- if (requireSwitch) typer.context.unit.error(scrut.pos, "could not emit switch for @switch annotated match")
+ if (requireSwitch) typer.context.unit.warning(scrut.pos, "could not emit switch for @switch annotated match")
if (casesNoSubstOnly nonEmpty) {
// before optimizing, check casesNoSubstOnly for presence of a default case,
@@ -0,0 +1 @@
+-Xfatal-warnings

0 comments on commit aee338d

Please sign in to comment.