-
Notifications
You must be signed in to change notification settings - Fork 111
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
Compile T::Enum with the enums
block
#243
Conversation
15a6ef0
to
ac807a5
Compare
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.
Looks great, thank you. Just a couple of comments.
d05a6f7
to
2de1a62
Compare
@paracycle - Thanks for the suggestions. Just committed them so this should be good for another look. |
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.
Yeap, this looks great!
@jeffcarbs You had signed the CLA before, right? I think it might be our CLA bot acting up. Do you mind amending your last commit and force-pushing to trigger it again? |
Co-authored-by: Ufuk Kayserilioglu <ufuk@paralaus.com>
2de1a62
to
2009875
Compare
Amending and force-pushing worked 👍 |
Motivation
With sorbet's
T::Enum
the enum values themselves are actually instances of the class that inherits fromT::Enum
. Tapioca doesn't handle these specially which affects sorbet's ability to perform exhaustiveness checking. Here's a repro on sorbet.run.Implementation
Specially handle
T::Enum
to define the enums using theenums do ... end
block and ignore the enum values from the normal compilation.Tests
See updated tests.