Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
adriaanm committed May 25, 2012
1 parent 032e8ae commit aee338d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions test/files/neg/switch.flags
@@ -0,0 +1 @@
-Xfatal-warnings

0 comments on commit aee338d

Please sign in to comment.