Closed
Description
TypeScript Version: nightly (2.0.0-dev.201xxxxx)
Code
class A {
foo = 'hello';
}
class B extends A {
bar = 'hello';
}
let a:A = new B();
if (a instanceof B) {
console.log(a.bar); // working
}
if (a instanceof B) {
setTimeout( () => {
console.log(a.bar); // error
});
}
Expected behavior:
TypeScript should recognize a as instance of B. This worked in 1.8
Actual behavior:
test.ts(17,17): error TS2339: Property 'bar' does not exist on type 'A'.