We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
enum Bool: case True case False import Bool._ enum SBool[B <: Bool]: case STrue extends SBool[True.type] case SFalse extends SBool[False.type] import SBool._ def f(b: SBool[True.type]): Unit = b match case STrue => ()
https://scastie.scala-lang.org/sFyhkz0wRg2Uvtl9GE37dQ
match may not be exhaustive. It would fail on pattern case: SFalse
I would expect f to be exhaustive because from the type parameter we can know that SFalse cannot occur. Is this a limitation of Dotty or a bug?
f
SFalse
The text was updated successfully, but these errors were encountered:
Fix scala#10085: check if enum case confirms to scrutinee type
149d4de
9627957
Merge pull request #10094 from dotty-staging/fix-10085
ea64026
Fix #10085: check if enum case confirms to scrutinee type
liufengyun
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Minimized code
https://scastie.scala-lang.org/sFyhkz0wRg2Uvtl9GE37dQ
Output
Expectation
I would expect
f
to be exhaustive because from the type parameter we can know thatSFalse
cannot occur. Is this a limitation of Dotty or a bug?The text was updated successfully, but these errors were encountered: