-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Make EngineEdition more readable #31038
Conversation
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.
Should we just type _engineEdition as EngineEdition? This way we can remove all the pesky casts.
How will that work with other/new engineedition values? |
It's always possible to cast the int read from the database to the enum - even if a label isn't defined for it. If we ever need to actually check that value, at that point we'd need to add a label for it, no? |
So in the case of an int value of f.ex. 5 you can still do this?? Guess I know too little about enums 😅 (EngineEdition)_engineEdition |
Yep :) You can always cast an enum to its underlying type (e.g. int) and vice versa. |
@roji Updated |
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.
Thanks @ErikEJ!
Fixes #31037