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

Make adjustments following issue #4015 #4103

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Make adjustments following issue #4015 #4103

merged 2 commits into from
Sep 26, 2024

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Sep 26, 2024

In issue #4015, it is argued that several system provided members of an enumerated declaration should not be augmentable, namely: index, hashCode, operator ==, and values. This PR makes it a compile-time error to augment them.

It was also suggested that it should be an error to declare or augment a member of an enum named name, because this identifier should denote the system provided extension getter name. This PR does not introduce any rules about name, because it would be a breaking change to prevent enum declarations from declaring a member whose name is name (instance or static).

Resolves #4015.

@eernstg
Copy link
Member Author

eernstg commented Sep 26, 2024

Hi, @sgrekhov! If and when this PR is landed, we'd need a couple of tests.

@sgrekhov
Copy link
Contributor

Sure!

@eernstg eernstg merged commit 13277c3 into main Sep 26, 2024
3 checks passed
@eernstg eernstg deleted the spec_4015_sep24 branch September 26, 2024 19:59
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.

Is it possible to augment the values of an enum?
3 participants