2014-08-15 23:33:16 +02:00
|
|
|
=== 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
|
2014-08-19 04:56:03 +02:00
|
|
|
>T5 : T5<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
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
|
2014-08-28 21:31:37 +02:00
|
|
|
>super : typeof T5
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: number = this.foo;
|
|
|
|
>x : number
|
|
|
|
>this.foo : number
|
|
|
|
>this : T6
|
|
|
|
>foo : number
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|