Add regression test

This commit is contained in:
Anders Hejlsberg 2019-02-03 15:23:21 -08:00
parent 415c725bb9
commit 0c5471ba5c

View file

@ -57,3 +57,36 @@ class Foo2
constructor() {
}
}
// Repro from #29513
class AInfo {
a_count: number = 1;
}
class BInfo {
b_count: number = 1;
}
class Base {
id: number = 0;
}
class A2 extends Base {
info!: AInfo;
}
class B2 extends Base {
info!: BInfo;
}
let target: Base = null as any;
while (target) {
if (target instanceof A2) {
target.info.a_count = 3;
}
else if (target instanceof B2) {
const j: BInfo = target.info;
}
}