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

Relax avoidance checks more for match type reduction #15036

Merged
merged 1 commit into from
May 3, 2022

Conversation

smarter
Copy link
Member

@smarter smarter commented Apr 26, 2022

TypeParamRefs in match types do not have a corresponding TypeVar so they get
assigned level Int.MaxValue by default, this means they can refer to variables
at any level, but to avoid a crash in i14921 we also need the reverse
direction (they can appear in the bounds of variables of any level), both
direction should be safe because these constraints only exist during match type
reduction (see MatchType#reduced).

Fixes #14921.

TypeParamRefs in match types do not have a corresponding TypeVar so they get
assigned level Int.MaxValue by default, this means they can refer to variables
at any level, but to avoid a crash in i14921 we also need the reverse
direction (they can appear in the bounds of variables of any level), both
direction should be safe because these constraints only exist during match type
reduction (see `MatchType#reduced`).

Fixes scala#14921.
@smarter
Copy link
Member Author

smarter commented Apr 26, 2022

I believe this should be backported since it fixes a regression introduced in 3.1.2.

@smarter smarter added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Apr 26, 2022
@smarter smarter requested a review from odersky April 26, 2022 13:45
@odersky odersky assigned smarter and unassigned odersky May 2, 2022
@smarter smarter added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels May 2, 2022
@smarter smarter merged commit 4bd275b into scala:main May 3, 2022
@smarter smarter deleted the relax-avoidance branch May 3, 2022 12:02
smarter added a commit to dotty-staging/dotty that referenced this pull request May 3, 2022
This backports scala#15036 which fixes a regression introduced in 3.1.2.
@griggt griggt added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels May 24, 2022
@Kordyjan Kordyjan added this to the 3.2.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
4 participants