KEMBAR78
delete enum support for bool as an underlying type by pedrobsaila · Pull Request #79962 · dotnet/runtime · GitHub
Skip to content

Conversation

@pedrobsaila
Copy link
Contributor

Fixes #79224

@ghost ghost added area-System.Runtime community-contribution Indicates that the PR has been added by a community member labels Dec 25, 2022
@ghost
Copy link

ghost commented Dec 25, 2022

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #79224

Author: pedrobsaila
Assignees: -
Labels:

area-System.Runtime

Milestone: -

@vargaz
Copy link
Contributor

vargaz commented Dec 28, 2022

The mono changes look ok to me.

@build-analysis build-analysis bot mentioned this pull request Dec 30, 2022
Copy link
Member

@stephentoub stephentoub left a 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)).
Copy link
Member

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.

Copy link
Contributor Author

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' ?

Copy link
Member

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.

@jkotas
Copy link
Member

jkotas commented Jan 6, 2023

Still want to nuke it?

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.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@jkotas jkotas merged commit f32ba52 into dotnet:main Jan 13, 2023
@pedrobsaila pedrobsaila deleted the 79224 branch January 13, 2023 08:30
@akoeplinger
Copy link
Member

@akoeplinger
Copy link
Member

ah ok, thanks

@stephentoub stephentoub added breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Jan 20, 2023
@ghost
Copy link

ghost commented Jan 20, 2023

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

@jkotas
Copy link
Member

jkotas commented Jan 20, 2023

Breaking change doc issue dotnet/docs#33647

stephentoub pushed a commit that referenced this pull request Jan 20, 2023
mdh1418 pushed a commit to mdh1418/runtime that referenced this pull request Jan 24, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2023
@ericstj ericstj added this to the 8.0.0 milestone Jun 28, 2023
@jkotas jkotas removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Oct 16, 2023
@jkotas
Copy link
Member

jkotas commented Oct 16, 2023

Breaking change doc created by dotnet/docs#36505

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtime breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider deleting enum support for bool as an underlying type from all runtimes

7 participants