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

Freeze constraints while calculating GADT full bounds #18222

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

dwijnand
Copy link
Member

While studying a bug, I discovered that the code I'd written to avoid
bidirectionalily in GADT fullBounds was inadvertently recording GADT
constraints, assisted by the fact that, when running without
-Yno-deep-subtypes, TypeComparer's escape hatch for deep recursions
avoids it crashing. For instance a GADT symbol was compared >: Nothing
and thus recorded as having Nothing as a lower bound.

So I added freezing, and while I was at it I updated the docs I hadn't
changed last time, and I made the subtyping check in the only direction
necessary.

While studying a bug, I discovered that the code I'd written to avoid
bidirectionalily in GADT fullBounds was inadvertently recording GADT
constraints, assisted by the fact that, when running without
-Yno-deep-subtypes, TypeComparer's escape hatch for deep recursions
avoids it crashing.  For instance a GADT symbol was compared >: Nothing
and thus recorded as having Nothing as a lower bound.

So I added freezing, and while I was at it I updated the docs I hadn't
changed last time, and I made the subtyping check in the only direction
necessary.
@dwijnand dwijnand marked this pull request as ready for review July 17, 2023 10:19
@dwijnand dwijnand requested a review from nicolasstucki July 17, 2023 10:19
@dwijnand dwijnand removed their assignment Jul 17, 2023
@nicolasstucki nicolasstucki merged commit 5ca1b01 into scala:main Jul 20, 2023
@dwijnand dwijnand deleted the gadt-fb-freeze branch July 20, 2023 09:14
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 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.

3 participants