-
Notifications
You must be signed in to change notification settings - Fork 160
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
fix the float based enum issue #4725
fix the float based enum issue #4725
Conversation
@@ -76,32 +76,7 @@ public static InputEnumType CreateEnumType(ref Utf8JsonReader reader, string? id | |||
throw new JsonException("Enum must have at least one value"); | |||
} | |||
|
|||
InputPrimitiveType? currentType = null; |
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.
Why remove the value type creation and validation? we may still need check the enum value types consistence.
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.
I will introduce a fix for this in a new PR to make it throws a proper exception
Fixes #4724
Description
Our float based enums are generated as based on int if all existing values are ints. For code examples please check the above issue.
This is incorrect and fixing it could be a breaking change - because the ctor changes for that enum:
but we could get breaking changes if we do not fix it, and users cannot put float values into this enum which is just wrong.
Checklist
To ensure a quick review and merge, please ensure:
Ready to Land?