TypeScript Version: 2.0.2
Code
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
TypeScript Version: 2.0.2
Code
Expected behavior:
(I think)
xshould still be inferred as type number in the inner function.Actual behavior:
xis inferred asany