-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Fix narrowing of intersection with function type #47483
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 |
Heya @DanielRosenwasser, I've started to run the extended test suite on this PR at e17ca56. You can monitor the build here. |
Heya @DanielRosenwasser, I've started to run the parallelized community code test suite on this PR at e17ca56. You can monitor the build here. |
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at e17ca56. You can monitor the build here. Update: The results are in! |
Heya @DanielRosenwasser, I've started to run the parallelized Definitely Typed test suite on this PR at e17ca56. You can monitor the build here. |
@DanielRosenwasser Here they are:Comparison Report - main..47483
System
Hosts
Scenarios
Developer Information: |
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
I'm curious why you've included function test(x: number & { _foo: string }) {
if (typeof x === 'object') {
x; // Used to narrow to never, now doesn't
}
} It's fairly common to have tagged primitives like that, but they shouldn't appear to be objects. |
I think function f1(x: F & { foo: number }) {
if (typeof x !== "object") {
x; // Narrows to `never` if `TypeFacts.TypeofNEObject` is an `and` mask
}
} However, there's also a mistake on the Made the fixes here: #47583 |
Fixes #45801.
Second attempt at a fix, first is in #47282 (along with some explanation of the issue).