TypeScript Version: nightly (2.1.0-dev.20161006)
Code
typeA_or_C_Child=A|C_Child;interfaceA{a: string;}interfaceB{b: string;}interfaceC{c: string;}interfaceC_ChildextendsA,C{extra: string;}declarefunctionisA(it: any): it is A;declarefunctionisB(it: any): it is B;declarefunctionisC(it: any): it is C;declarefunctionisA_or_C_Child(it: any): it is A_or_C_Child;letitem: any;if(isA_or_C_Child(item)&&!isC(item)&&isB(item)){item;// inferred as A & B}if(isA_or_C_Child(item)&&isB(item)&&!isC(item)){item;// inferred as A_or_C_Child & B}Expected behavior:
Within the the last two if statements, item should be inferred to be the same type, as both if statements use the same type guards &&ed together.
Actual behavior:
item is (correctly, I think) inferred as A & B in the first if, but as A_or_C_Child & B in the second.
TypeScript Version: nightly (2.1.0-dev.20161006)
Code
Expected behavior:
Within the the last two if statements, item should be inferred to be the same type, as both if statements use the same type guards
&&ed together.Actual behavior:
itemis (correctly, I think) inferred asA & Bin the first if, but asA_or_C_Child & Bin the second.