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

Allow refineUsingParent to infer GADT bounds #15706

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Jul 19, 2022

Not doing so makes the type var interpolation between typer and the match space analysis different, which can result in false positive and negative exhaustivity and reachability warnings.

@dwijnand dwijnand linked an issue Jul 19, 2022 that may be closed by this pull request
@dwijnand dwijnand changed the title Defer param replacement when inferring GADT constraints Allow refineUsingParent to infer GADT bounds Jul 26, 2022
Not doing so makes the type var interpolation between typer and the
match space analysis different, which can result in false positive and
negative exhaustivity and reachability warnings
@dwijnand dwijnand linked an issue Jul 26, 2022 that may be closed by this pull request
@dwijnand dwijnand marked this pull request as ready for review July 26, 2022 22:07
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! It makes total sense to retract GADT bounds right at the point we try to record them; I knew that there has to be some problem with us not retracting the bounds if they become absurd, but I never quite got to tracing it down and fixing the situation. Nice job with tracing it down, @Linyxus!

@abgruszecki abgruszecki merged commit 0c4c967 into scala:main Jul 27, 2022
@dwijnand dwijnand deleted the one-tparam-used-twice branch July 27, 2022 16:56
@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 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.

Incorrect non-exhaustivity warning in pattern matches False positive exhaustivity warning on GADTs
4 participants