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

Don't add values to enums that can't be parsed #1836

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

Saalvage
Copy link
Contributor

Currently if one of the values of an enum can't be parsed it's still added to the enum on the C# side of things with a value of 0. This PR changes it so that values that can't be parsed are not added to the enum on the C# side.

Although this is theoretically a breaking change I cannot imagine circumstances in which the current behavior is preferable and only a slight change to how the invalid values are handled should be required for code that manually deals with the unparseable values.

@tritao
Copy link
Collaborator

tritao commented Mar 13, 2024

OK with merging this, but CI is failing for some reason.

@Saalvage
Copy link
Contributor Author

Stupid me!

But as it turns out this seems to have been intended behavior at some point in time, however I really struggle to see any justification for it.

@tritao tritao merged commit 81e0a93 into mono:main Mar 14, 2024
5 checks passed
@Saalvage Saalvage deleted the fix/no-unparsed-enum-values branch March 14, 2024 14:33
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.

2 participants