TypeScript Version: 2.0.0
Code
classA<T>{private_: T;}classB<T>{private_: T;}functionf(){varo: A<void>|B<void>=newB<void>();if(oinstanceofA)returno;// B<void> & A<any>, should be A<void>}Expected behavior:
A type of o narrowed by type guard is A<void>.
Actual behavior:
A type of o narrowed by type guard is B<void> & A<any>.
TypeScript Version: 2.0.0
Code
Expected behavior:
A type of
onarrowed by type guard isA<void>.Actual behavior:
A type of
onarrowed by type guard isB<void> & A<any>.