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

Split Enum value type from EnumTypeWrapper #120

Merged
merged 1 commit into from
May 13, 2020
Merged

Split Enum value type from EnumTypeWrapper #120

merged 1 commit into from
May 13, 2020

Conversation

nipunn1313
Copy link
Owner

@nipunn1313 nipunn1313 commented May 13, 2020

This fixes the conflation of the value type from the EnumTypeWrapper in the typing.

Added tests to confirm that we correctly error if used incorrectly.

Fixes #118

@nipunn1313
Copy link
Owner Author

Note that this approach takes the opinionated approach of returning a NewType over the int

If you try to construct a message passing an int to the constructor, it will fail, expecting to be wrapped in the NewType

@pcorpet
Copy link
Contributor

pcorpet commented May 28, 2020

FYI this is breaking our type checks, and it's not as simple as replacing MyEnum by MyEnumValue because MyEnumValue exists only during type checking. I'm converting all those types to string MyEnum => 'MyEnumValue'

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.

Message enum attributes have incorrect type annotations
2 participants