Open
Description
TypeScript Version: 3.1.0-dev.201xxxxx
Search Terms: override generic
Code
interface Foo {
method<T>(): T;
}
// Error: Interface 'Bar<T>' incorrectly extends interface 'Foo'.
interface Bar<T extends Node> extends Foo {
method<T2 extends T>(): T2;
}
// Uncommenting this suddenly fixes the error
// interface Foo {
// method<T>(): T;
// }
Full error message:
Interface 'Bar<T>' incorrectly extends interface 'Foo'.
Types of property 'method' are incompatible.
Type '<T2 extends T>() => T2' is not assignable to type '<T>() => T'.
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
Type 'Node' is not assignable to type 'T'.
Expected behavior: The error should always appear, or always not appear.
Actual behavior: A partial interface mysteriously removes the error
Related Issues: #23960