Closed
Description
TypeScript Version: 2.8.1
Search Terms: NonNullable, this
Code
class X {
fn(): void {
// Type 'this' is not assignable to type 'NonNullable<this>'.
// Type 'X' is not assignable to type 'NonNullable<this>'.
const x: NonNullable<this> = this;
// ~
}
}
Expected behavior:
A reference of type this
should be assignable to a NonNullable<this>
within a method.
Actual behavior:
this
is not assignable to NonNullable<this>
.
Playground Link:
Related Issues: