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

Add type parameters derived from enum to default param getters of enum cases #22157

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

kasiaMarek
Copy link
Contributor

fixes: #22137

@kasiaMarek kasiaMarek marked this pull request as ready for review December 9, 2024 09:01
@Gedochao Gedochao requested review from dwijnand and odersky December 9, 2024 09:06
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

I almost feel like we should fix the constructor, by giving it type parameters, afterwhich the default getters would have the type parameters. But going straight from contextual enum class type parameters to modifying the default getters also works (though we're skipping the dropContextBounds call, so that might matter eventually).

@kasiaMarek
Copy link
Contributor Author

though we're skipping the dropContextBounds call, so that might matter eventually

I assumed it's might be fine to skip it since rhs is always DerivedFromParamTree for these type params.

@kasiaMarek kasiaMarek merged commit 6b9f9f7 into scala:main Dec 12, 2024
29 checks passed
@SethTisue
Copy link
Member

Nice — thanks for the quick fix 👍

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.

In enum with type parameter, can't call constructor for enum case with default argument
3 participants