Skip to content

Decide when we should do exhaustivity checks #1351

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

Closed
DarkDimius opened this issue Jul 1, 2016 · 3 comments
Closed

Decide when we should do exhaustivity checks #1351

DarkDimius opened this issue Jul 1, 2016 · 3 comments
Assignees

Comments

@DarkDimius
Copy link
Contributor

scalac only checks sealed classes. We should consider if we indeed want to change this.
https://github.com/lampepfl/dotty/pull/1261/files#diff-3fbc86b62f6455f297c02b6711bc66b1R470

In case we indeed decide to change it, I propose to maintain scalac compatible behavior in -language:Scala2 mode.

@DarkDimius
Copy link
Contributor Author

DarkDimius commented Jul 1, 2016

Spec says

If the selector of a pattern match is an instance of a sealed class, 
the compilation of pattern matching can emit warnings which 
diagnose that a given set of patterns is not exhaustive,
 i.e. that there is a possibility of a MatchError being raised at run-time.

This is the only reference to exhau* pattern matching spec.

@DarkDimius DarkDimius changed the title Decide when we should do exhastivity checks Decide when we should do exhaustivity checks Jul 1, 2016
@liufengyun
Copy link
Contributor

liufengyun commented Jul 6, 2016

dotty meeting: Follow the same approach as in scalac for now.

@liufengyun
Copy link
Contributor

This is done in the #1364

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

No branches or pull requests

2 participants