TypeScript/tests/baselines/reference/superCallArgsMustMatch.types
2014-08-15 14:37:48 -07:00

38 lines
539 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
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
var x: number = this.foo;
>x : number
>this.foo : number
>this : T6
>foo : number
}
}