-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead
Description
This code causes an error:
type X<A> = {x: A}
interface Foo {
// works
a(): X<this>
// does not work
b(): {x: this}
}
Output:
foo.ts(7,11): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
It errors if the object type is defined inline, but works for a typedef.
Metadata
Metadata
Assignees
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead