Closed
Description
Here's an example which demonstrates (tested on 1.6.2 and current playground):
class Foo {
a: number;
foo(): string {
if (this instanceof Bar) {
return this.b; // not okay - `this` typed as Foo
}
return '';
}
bar(): string {
let that = this;
if (that instanceof Bar) {
return that.b; // okay - `that` typed as Bar
}
return ''
}
}
class Bar extends Foo {
b: string;
}