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
classtest1{someProp;}classtest2{anotherProp;}letmyTest: test1|test2;if(myTestinstanceoftest1){// validmyTest.someProp;// invalid, someProp does not exist on type 'test2'()=>myTest.someProp;// meaning if you have a eg. forEach[].forEach(()=>{// you will need an instance check here too// invalidmyTest.someProp;// validif(myTestinstanceoftest1)myTest.someProp;})}
Expected behavior:
I expected typescript to know myTest was instanceof test1 inside the function. It did not give these errors in typescript 1.8
Actual behavior:
It lost this knowledge inside the function.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.2.0-dev.20170113
Code
Expected behavior:
I expected typescript to know myTest was instanceof test1 inside the function. It did not give these errors in typescript 1.8
Actual behavior:
It lost this knowledge inside the function.
The text was updated successfully, but these errors were encountered: