-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
interface Foo<T> {
thing: T;
}
interface Bar extends Foo<this> {
thing: this;
}
class Foo<T> {
thing: T;
}
class Bar extends Foo<this> {
thing: this;
}
interface Foo<T> {
thing: T;
}
class Bar implements Foo<this> {
thing: this;
}
These examples have an error on the 'this' type argument of Foo
:
TS2526 A 'this' type is available only in a non-static member of a class or interface.
Since an object type cannot reference a type parameter directly within a heritage clause, we shouldn't be giving this error.
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript