Uh oh!
There was an error while loading. Please reload this page.
update contextual discrimination to include omitted members - #43633
update contextual discrimination to include omitted members#43633Wesley Wigham (weswigham) merged 1 commit into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Erik Brinkman (erikbrinkman)
commented
Apr 13, 2021
Wesley Wigham (@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. |
Under the TS 4.3 beta, this change appears to have introduced a stack overflow in my codebase: |
Erik Brinkman (erikbrinkman)
commented
May 4, 2021
Andrew Schmadel (@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 |
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.