-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Fix stack overflow in JSX discriminated union logic #46354
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
I suspect this also fixes #45632, though we don't have a repro for that one. |
Just out of curiosity @typescript-bot perf test this |
Heya @andrewbranch, I've started to run the perf test suite on this PR at 7f5a96a. You can monitor the build here. Update: The results are in! |
@andrewbranch Here they are:Comparison Report - main..46354
System
Hosts
Scenarios
Developer Information: |
What exactly was happening here? |
It was a case of the contextual type for an expression depending on the expression itself--which is never supposed to happen. The circularity only happened for a JSX element with a discriminated union type. |
I got that from the code change, but I couldn’t quite grok the circular dependency in the test case. |
In |
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.
Thanks for the explanation!
* Use getContextFreeTypeOfExpression to avoid circularities * Add regression test
Fixes #46021.