Skip to content

Fix #1292: give position when failing to emit switch on annotated match #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2016

Conversation

felixmulder
Copy link
Contributor

@felixmulder felixmulder commented Jun 2, 2016

This fix gives the position and refactors the code that gave off
warnings, but it also begs the question - should we be able to handle
emitting a switch for the following case:

(x: @switch) match {
  case 'a' if somePredicate(x) => // ...
  case 'b' => // ...
}

Currently if there is a guard, the patternmatcher will fail to emit
a switch. Scalac can handle these cases currently.

review: @DarkDimius

…d match

This fix gives the position and refactors the code that gave off
warnings, but it also begs the question - should we be able to handle
emitting a switch for the following case:

```scala
(x: @switch) match {
  case 'a' if somePredicate(x) => // ...
  case 'b' => // ...
}
```

Currently if there is a guard, the patternmatcher will fail to emit
a switch. Scalac can handle these cases currently.
@DarkDimius
Copy link
Contributor

LGTM

@DarkDimius DarkDimius merged commit 845b981 into scala:master Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants