core icon indicating copy to clipboard operation
core copied to clipboard

TypeScript: abstract method implemented with the wrong type parameter

Open Tarmil opened this issue 8 years ago • 0 comments

Failing test

This is what the above translates to (stripped to show the issue):

class ClassA<T0> { Z(x?:T0):T0 { return; } }
class ClassB<T0, T1> extends ClassA<T1> { Z(x?:T0):T0 { return x; } }

Note how ClassB extends ClassA<T1> but its Z is still declared as taking and returning T0; it should be T1 instead.

Tarmil avatar Oct 24 '17 08:10 Tarmil