Uh oh!
There was an error while loading. Please reload this page.
Fix narrowing of intersection with function type - #47483
Conversation
TypeScript Bot (@typescript-bot) test this |
Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the extended test suite on this PR at e17ca56. You can monitor the build here. |
Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the parallelized community code test suite on this PR at e17ca56. You can monitor the build here. |
Heya Daniel Rosenwasser (@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 Daniel Rosenwasser (@DanielRosenwasser), I've started to run the parallelized Definitely Typed test suite on this PR at e17ca56. You can monitor the build here. |
TypeScript Bot (typescript-bot)
commented
Jan 21, 2022
Daniel Rosenwasser (@DanielRosenwasser) Here they are:Comparison Report - main..47483
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Jan 21, 2022
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
Anders Hejlsberg (ahejlsberg)
commented
Jan 22, 2022
I'm curious why you've included functiontest(x: number&{_foo: string}){if(typeofx==='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 functionf1(x: F&{foo: number}){if(typeofx!=="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).