Skip to content
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

Deskolemise patterns to suppress exhaustivity warnings #13137

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

dwijnand
Copy link
Member

Ideally I'd want to not be destructive with this widen, but it seems to
already being done on the other side: in signature where the
components of the unapply result type are obtained the call to:

mt.instantiate(scrutineeTp :: Nil).finalResultType

removes the more precise blub.type that was present in the signature.

So now, by widening the pattern the spaces cancel each other out,
thus the match is deemed exhaustive.

Fixes #13110

Ideally I'd want to not be destructive with this widen, but it seems to
already being done on the other side: in `signature` where the
components of the unapply result type are obtained the call to:

    mt.instantiate(scrutineeTp :: Nil).finalResultType

removes the more precise `blub.type` that was present in the signature.

So now, by widening the pattern the spaces cancel each other out,
thus the match is deemed exhaustive.
Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@abgruszecki abgruszecki merged commit b830af3 into scala:master Aug 26, 2021
@dwijnand dwijnand deleted the patmat-dep branch August 26, 2021 20:24
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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.

Spurious exhaustivity warning using an irrefutable unapply with a singleton type
3 participants