-
Notifications
You must be signed in to change notification settings - Fork 1
FEATURE: typed enum access and strict enum matches #12
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fail if enum doesnt have this property - resolve property value type
- reimplement #9 cleaner - enum static will be converted to enum instance in ComponentScope, but enum static is the imported type - Remove global ButtonType hack in the tests and import it correctly in the Match.afx - ModuleScope::lookupTypeFor didnt work for imported enums (IdentifierResolver Failed) Match related: - multiple default arms -> throws - if there is no default arm and not all enum members are listed -> throws - if enum members are listed twice -> throws - if enum is matched against non enum member -> throws - if enum is matched against other enum -> throws
mhsdesign
commented
Apr 8, 2023
…o account previously enums where only compared by name and not import path (module id)
this modeling is imo correct, as this will allow this in the future ``` Enum.A.value ``` `Enum.A` is an EnumInstanceType (which knows that its name is "A") while Enum is just an EnumStaticType if an enum is referenced like `enum: Enum` an unspecific instance (without known MemberName) will be used
…rencedInTheComponentApi
… throw if isUnspecified
6ae7f1c
to
5a33cc5
Compare
grebaldi
approved these changes
Aug 5, 2023
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 a lot @mhsdesign!
(And sorry again for the long delay 😅)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While implementing an accessType resolver i noticed that my other pr: #9 "Enums ensure that match is complete" can be implemented cleaner, so its contents have been copied into this pr and #9 is now obsolete.
Match related: