You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A *self-contained* demonstration of the problem follows...// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.interfaceX{type: 'A'}functionffff3(x: X){if(x.type==='A'){return;}x// should be never, but still X.}
Expected behavior:
the type of variable x in the last line of the function should be narrowed to never.
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Code
Expected behavior:
the type of variable x in the last line of the function should be narrowed to never.
Actual behavior:
It is not narrowed.
Playground Link:
https://www.typescriptlang.org/play/index.html#code/JYOwLgpgTgZghgYwgAgBrIN4Chm+WATwAcIAuZAcgEEKsBfLUSWRFATUxz0JPIrdoMsMAK4gEYYAHsQyGPJgBmABQAPcqgA+bAJSc8yYDGRqAdDxQBea5Rp7sBg1AhgRUEAG4uuBgaMnVc2IrG34Ke29HZ1d3LwNfPFV6IA
Related Issues:
The text was updated successfully, but these errors were encountered: