-
Notifications
You must be signed in to change notification settings - Fork 13.2k
No union subtype reduction during type inference #37327
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
Conversation
|
@typescript-bot run dt |
|
Heya @ahejlsberg, I've started to run the extended test suite on this PR at ef03050. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized community code test suite on this PR at ef03050. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at ef03050. You can monitor the build here. |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
orta
left a comment
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.
Looks good, thanks for looking into it!
|
@ahejlsberg thanks a lot 🙏 |
One thing that immediately stands out in the stack trace for #31230 is that we're performing subtype reduction (
removeSubtypes) on a union type during inference. We shouldn't be doing that, at least not without recursion limiters in place, because subtype reduction checks relations, which may perform inference, and off we go. It appears that removing theUnionReduction.Subtypeflag where we construct a union type ingetImplicitIndexTypeOfTypefixes the issue.Fixes #31230.