-
Notifications
You must be signed in to change notification settings - Fork 5.2k
delete enum support for bool as an underlying type #79962
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
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsFixes #79224
|
|
The mono changes look ok to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. @jkotas, your suggestion was about considering removing bool; we later got data confirming it's very rarely (but not 100% never) used. Still want to nuke it?
|
|
||
| ### II.14.3 Enums (page 168) | ||
|
|
||
| Enum support for bool as underlying type was deleted (see [issue 79224](https://github.com/dotnet/runtime/issues/79224)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is deleting the bool backed enum support from the reflection stack.
The bool backed enums are still going to work loaded fine by the type loader. I think that it is the right tradeoff between compat and simplicity. The type loader support for bool backed enums is very cheap and simple.
ECMA-335 and this doc is concerned about the behavior of the core runtime (that is not changing), not about behavior of BCL APIs. I think this note should be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the 'type loader' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type loader is a component responsible for loading types.
For example, Console.WriteLine(typeof(BoolEnum)); is still going to work fine even with these changes because the type loader still works fine for bool enums with these changes.
Yes, I think it is fine to nuke it from parsing, formatting and conversions. I would keep it in the core type loader - it does not cost anything there. |
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
|
Can we update https://github.com/dotnet/runtime/blob/main/docs/design/specs/Ecma-335-Augments.md with this? |
|
ah ok, thanks |
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
Partial revert of dotnet#79962 Fixes dotnet#80890
|
Breaking change doc issue dotnet/docs#33647 |
Partial revert of dotnet#79962 Fixes dotnet#80890
|
Breaking change doc created by dotnet/docs#36505 |
Fixes #79224