Conversation
Perryvw
reviewed
Feb 15, 2019
| @TestCase("inst.field | 3", 8 | 3) | ||
| @TestCase("inst.field << 3", 8 << 3) | ||
| @TestCase("inst.field >> 1", 8 >> 1) | ||
| @TestCase("inst.field = 3", 7) |
Member
There was a problem hiding this comment.
Is this test right? We should verify if typescript returns the literal number or the field getter.
Collaborator
Author
There was a problem hiding this comment.
This was previously returning the wrong value. When an assignment is evaluated, the value on the right is returned. The left should not be evaluated. Playground
- removed special case for numerical literals when comparing property names - added tests for accessors overriding other accessors
Perryvw
approved these changes
Feb 16, 2019
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
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.
fixes #206
This only affects classes that have getters and/or setters. I went with the solution here: #206 (comment)
One edge-case to note is this:
Because prop is assigned directly to the instance in the base class, the getter defined in the derived class would never be accessed. My solution to this is to detect this specific case and set the instance's property to back nil in derived class' constructor.
Since the base property is effectively inaccessible in this situation, I don't think this should cause any undesirable side-effects.