42 lines
589 B
Text
42 lines
589 B
Text
=== tests/cases/compiler/superWithGenericSpecialization.ts ===
|
|
class C<T> {
|
|
>C : C<T>
|
|
>T : T
|
|
|
|
x: T;
|
|
>x : T
|
|
>T : T
|
|
}
|
|
|
|
class D<T> extends C<string> {
|
|
>D : D<T>
|
|
>T : T
|
|
>C : C<string>
|
|
|
|
y: T;
|
|
>y : T
|
|
>T : T
|
|
|
|
constructor() {
|
|
super(); // uses the type parameter type of the base class, ie string
|
|
>super() : void
|
|
>super : typeof C
|
|
}
|
|
}
|
|
|
|
var d: D<number>;
|
|
>d : D<number>
|
|
>D : D<T>
|
|
|
|
var r: string = d.x;
|
|
>r : string
|
|
>d.x : string
|
|
>d : D<number>
|
|
>x : string
|
|
|
|
var r2: number = d.y;
|
|
>r2 : number
|
|
>d.y : number
|
|
>d : D<number>
|
|
>y : number
|
|
|