Accessors-override-property error allows possibly-correct synthetic properties#42635
Closed
Accessors-override-property error allows possibly-correct synthetic properties#42635
Conversation
This is the simplest fix -- I'm going to check whether it's worthwhile to make it stricter next. Fixes #41347
Contributor
|
Will this change be incompatible with @RyanCavanaugh's investigation into accessors? Having |
Member
Author
|
There might be a merge conflict, but Ryan's investigation would just change the function ('orthogonal' is overused but it applies here.) |
sandersn
added a commit
that referenced
this pull request
Feb 10, 2021
Originally from #42635, but this version is simpler.
Member
Author
|
#41994 now includes this change, so I'll close this PR. |
sandersn
added a commit
that referenced
this pull request
May 31, 2022
* remove too-late fix * Allow any property from a mapped type * turn off error for any non-class base * Also handle synthetic properties more laxly Originally from #42635, but this version is simpler. * update baselines * Update baselines * createUnionProperty of accessors creates an accessor Seems simple and doesn't break much. I need to double-check the few test failures, however. * Fix computation of write type of accessors * Calculate property-vs-accessor in existing loop Instead of looping over the props list 3 more times. * Undo synthetic accessor change * Minimise diff
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Previously, accessors could not override synthetic properties, such as those created by an intersection, at all if any constituent had the Property symbol flag set. The set of exemptions for abstract or interface-derived properties didn't apply. This PR instead allows those exemptions to apply if they apply to any of the synthetic property's declarations. This allows a mixin pattern used in rush to work.
Fixes #41347