-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Document irrefutable unapply in pattern matching #6490
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
Comments
See also the (incomplete) notion of an irrefutable pattern in the spec: https://www.scala-lang.org/files/archive/spec/2.12/08-pattern-matching.html#irrefutable-patterns |
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 12, 2019
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 15, 2019
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 15, 2019
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Dec 13, 2019
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Dec 13, 2019
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unapply that return
Some[X]
ortrue
are statically known to always match, and the exhaustiveness checker uses this knowledge (see https://github.com/lampepfl/dotty/blob/494f9e6c2a397ab47a08d16d09d64c88c4a0ee82/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala#L285-L294). This should be documented in http://dotty.epfl.ch/docs/reference/changed-features/pattern-matching.htmlThe text was updated successfully, but these errors were encountered: