-
Notifications
You must be signed in to change notification settings - Fork 12.8k
fix(46909):Fix typePredicate in UnionType #47172
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
I'm getting an error in privateNameInInExpression.ts, but it didn't happen locally. |
c068103
to
3f0423d
Compare
3f0423d
to
465c0ba
Compare
if (!isTypeSubtypeOf(unionAssignableType, assignableType)) { | ||
assignableType = unionAssignableType; | ||
} |
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.
This branch is included because even if the types of assignableType
and unionAssignableType
are the same, the symbols change.
If there is a more appropriate function than isTypeSubtypeOf
, I would like to use it.
@typescript-bot pack this |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 465c0ba. You can monitor the build here. |
Heya @weswigham, I've started to run the extended test suite on this PR at 465c0ba. You can monitor the build here. |
Heya @weswigham, I've started to run the tarball bundle task on this PR at 465c0ba. You can monitor the build here. |
Heya @weswigham, I've started to run the perf test suite on this PR at 465c0ba. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the diff-based community code test suite on this PR at 465c0ba. You can monitor the build here. Update: The results are in! |
Hey @weswigham, 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 |
@weswigham |
@weswigham Here they are:Comparison Report - main..47172
System
Hosts
Scenarios
Developer Information: |
Yowch, this is an 8% perf hit in a union + type guard heavy codebase. Any way we can mitigate that? That big a diff is something we've blocked bigger issues on. |
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.
Unfortunately, I think the perf's gonna need to improve in the compiler-unions suite before we can take this fix. We may need to get creative to keep the perf cost down.
@islandryu |
@sandersn |
Fixes #46909