-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Properly handle null and undefined in getCommonSupertype #50021
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 test this |
@typescript-bot test this |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at d4a239c. You can monitor the build here. |
@typescript-bot user test this inline |
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at d4a239c. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at d4a239c. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at d4a239c. You can monitor the build here. |
@typescript-bot pack this |
Heya @ahejlsberg, I've started to run the tarball bundle task on this PR at d4a239c. You can monitor the build here. |
@ahejlsberg Here they are:Comparison Report - main..50021
System
Hosts
Scenarios
Developer Information: |
Heya @ahejlsberg, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
@ahejlsberg |
Hey @ahejlsberg, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
Tests and performance all look good. No new errors, but one error went away in RWC because of better inference. I think this is a good fix. |
Latest commit adds more tests that now succeed but previously failed. |
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 great. I should have known that literals needed the same treatment!
(filterType
is another helper I need to commit to memory as existing.)
This is an alternative fix for #49938 that supercedes #49981.
@jakebailey I found it easier to put up a new PR. I've copied the tests from #49981. This PR more uniformly lifts
undefined
andnull
from the inference candidates and then adds them back later, plus it's a bit better at avoiding duplicate work. For example, it handles this case that otherwise is an error: