update contextual discrimination to include omitted members#43633
Merged
weswigham merged 1 commit intomicrosoft:masterfrom Apr 24, 2021
erikbrinkman:omitted-discriminated-union
Merged
update contextual discrimination to include omitted members#43633weswigham merged 1 commit intomicrosoft:masterfrom erikbrinkman:omitted-discriminated-union
weswigham merged 1 commit intomicrosoft:masterfrom
erikbrinkman:omitted-discriminated-union
Conversation
weswigham
reviewed
Apr 12, 2021
weswigham
reviewed
Apr 12, 2021
This diff extends the types checked by discriminateContextualTypeByObjectMembers and discriminateContextualTypeByJSXAttributes to also include any optional components in the type union. fixes #41759 although it doesn't address the better error reporting for their last repro, which I'm not sure how to address.
Contributor
Author
|
@weswigham that check makes sense. It should be resolved, although I had trouble accepting the changes through gh. Thanks for the pointers of where to start btw, probably wouldn't have thrown this together without them. |
weswigham
approved these changes
Apr 24, 2021
|
Under the TS 4.3 beta, this change appears to have introduced a stack overflow in my codebase: |
Contributor
Author
|
@schmod can you provide more context? Ideally a minimum working example, and even more ideally a bisect showing it was this commit? The call stack seems to indicate that it's causing a stack overflow at |
9 tasks
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.
This diff extends the types checked by
discriminateContextualTypeByObjectMembersanddiscriminateContextualTypeByJSXAttributesto also include any optional components in the type union.fixes #41759 although it doesn't address the better error reporting for their last repro, which I'm not sure how to address.