Skip to content

GADTs: widen only top-level variant params #11711

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

Merged
merged 1 commit into from
Mar 12, 2021
Merged

Conversation

abgruszecki
Copy link
Contributor

Fixes #11565.

The change to an unrelated test file is to clarify what should and shouldn't be inferred.

@abgruszecki abgruszecki requested a review from smarter March 12, 2021 11:14
@abgruszecki
Copy link
Contributor Author

The fix is quite simple: we should only widen top-level variant type params - remember that the widening is there only to trick TypeComparer into doing comparison between the appropriate type params. The doc comment for the function even implies that only top-level params should be widened.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

The fix is quite simple: we should only widen top-level variant type params - remember that the widening is there only to trick TypeComparer into doing comparison between the appropriate type params. The doc comment for the function even implies that only top-level params should be widened.

That whole comment should go in the commit message.

@smarter smarter merged commit 1e30fc2 into scala:master Mar 12, 2021
@smarter smarter deleted the i11565 branch March 12, 2021 17:29
@abgruszecki
Copy link
Contributor Author

Oh, I was going to add the comment to the commit message, but I got distracted. Anyway, it's the source already (it's one of those Huge Alex Comments), so I guess it's fine.

@Kordyjan Kordyjan added this to the 3.0.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.

Unsound GADT infered constraints when mixing invariant and variant type constructors
3 participants