Skip to content

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

Merged
tritao merged 3 commits intomono:mainfrom
Saalvage:fix/no-unparsed-enum-values
Mar 14, 2024
Merged

Don't add values to enums that can't be parsed#1836
tritao merged 3 commits intomono:mainfrom
Saalvage:fix/no-unparsed-enum-values

Conversation

@Saalvage
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

tritao commented Mar 13, 2024

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

@Saalvage
Copy link
Copy Markdown
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
@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