-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Compute writeType from set accessors for union and intersection properties #47674
Conversation
if (!links.writeType && links.deferralWriteConstituents) { | ||
Debug.assertIsDefined(links.deferralParent); | ||
Debug.assertIsDefined(links.deferralConstituents); | ||
links.writeType = links.deferralParent.flags & TypeFlags.Union ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents); |
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.
Shouldn't the write type of a union be resolved into an intersection type? Just like the way mentioned in #30769
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.
If you come up with a code example that doesn’t work the way you expect, feel free to file an issue.
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.
If you come up with a code example that doesn’t work the way you expect, feel free to file an issue.
Please have a look at the unsound behavior described in #50142. A comment indicates that it should be treated using the same rule of #30769.
I'm not quite sure but I guess it could have relation to this PR, where the write type of a union is not resolved into an intersection, but a union.
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.
Fixes #45376