39 lines
562 B
Plaintext
39 lines
562 B
Plaintext
=== tests/cases/compiler/superCallArgsMustMatch.ts ===
|
|
class T5<T>{
|
|
>T5 : T5<T>
|
|
>T : T
|
|
|
|
public foo: T;
|
|
>foo : T
|
|
>T : T
|
|
|
|
constructor(public bar: T) { }
|
|
>bar : T
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
class T6 extends T5<number>{
|
|
>T6 : T6
|
|
>T5 : T5<T>
|
|
|
|
constructor() {
|
|
|
|
super("hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause
|
|
>super("hi") : void
|
|
>super : typeof T5
|
|
|
|
var x: number = this.foo;
|
|
>x : number
|
|
>this.foo : number
|
|
>this : T6
|
|
>foo : number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|