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
functionisNumber(test: number|string): test is number{returntypeoftest==="number";}functionblah(arg: ()=>void): void{}letx: any=4;if(isNumber(x)){x;// x is correctly narrowed to number hereblah(()=>{x;// typeof x is any again})}
Expected behavior:
(I think) x should still be inferred as type number in the inner function.
Actual behavior: x is inferred as any
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.0.2
Code
Expected behavior:
(I think)
x
should still be inferred as type number in the inner function.Actual behavior:
x
is inferred asany
The text was updated successfully, but these errors were encountered: