-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
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;
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this