-
Notifications
You must be signed in to change notification settings - Fork 10.5k
NFC: Use enum class for ActionClass. #15446
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
Conversation
@swift-ci please smoke test |
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 wish disabling implicit conversions wasn't tied to redundant scoping. Can we rename it to Kind or something so that "Action" isn't in the name twice?
There's already an instance variable called |
@davidungar Have you considered making this a struct enum instead? The struct enum pattern allows for one to add methods to enums. Or is this used more as a pure enum? |
This is a Kind enum like the ones used for For the name, I might suggest cheating by calling the field "RawKind", since it's being stored as an |
dfe5935
to
a3ee808
Compare
@swift-ci please smoke test |
@gottesmm Thanks for the idea! Will keep it this way for now, since it's @jrose-apple 's code. |
@davidungar I did not read the code, so I accepted Jordan's explanation. If you guys add a bunch of helper functions, it may make sense to perform that transition to change the helper functions to methods on a struct enum. But if you are only using it for dyn_cast, I feel that there is less strength in the case. |
A small driver change inspired by batch mode: replacing an
enum
with anenum class
to better enable future refactoring.