-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
TypeScript Version: 2.4.1
Code
This works fine:
class Foo {
_foo: number;
foo(): this["_foo"] {
return this._foo;
}
}
This works fine:
class Foo {
protected _foo: number;
foo(): Foo["_foo"] {
return this._foo;
}
}
I expect this to work, but it does not work:
class Foo {
protected _foo: number;
foo(): this["_foo"] {
return this._foo;
}
}
It fails with this error:
(4,10): error TS2536: Type '"_foo"' cannot be used to index type 'this'.
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed