TypeScript Version: 3.2.0+
Code
classAInfo{a_count:number=1;}classBInfo{b_count:number=1;}classBase{next:Base;id:number=0;}classAextendsBase{constructor(readonlyinfo:AInfo){super();}}classBextendsBase{constructor(readonlyinfo:BInfo){super();}}lettarget:Base= ...;while(target){if(targetinstanceofA){target.info.a_count=3;}elseif(targetinstanceofB){target.info.b_count=3;}target=target.next;}Expected behavior:
TS2551: Property 'b_count' does not exist on type 'AInfo'. Did you mean 'a_count'?
When code place in WHILE

Actual behavior:
no error
TypeScript Version: 3.2.0+
Code
Expected behavior:
TS2551: Property 'b_count' does not exist on type 'AInfo'. Did you mean 'a_count'?
When code place in WHILE
Actual behavior:
no error