Closed
Description
Bug Report
π Search Terms
thisType is not narrowed
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
β― Playground Link
Playground link with relevant code
π» Code
class Base {
f() {
if (this instanceof D1) {
const s: this = this;
s.f1();
this.f1();
}
}
}
class D1 {
f1() {}
}
π Actual behavior
compiler throws an error on s.f1()
: Property 'f1' does not exist on type 'Base'.
π Expected behavior
should have no error.