2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericClasses3.ts ===
|
|
|
|
class B<T> {
|
|
|
|
>B : B<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
a: T;
|
|
|
|
>a : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
b: T;
|
|
|
|
>b : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
class C<T> extends B<T> {
|
|
|
|
>C : C<T>
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>B : B<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
public x: T;
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
var v2: C <string>;
|
|
|
|
>v2 : C<string>
|
2014-08-19 04:56:03 +02:00
|
|
|
>C : C<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var y = v2.x; // should be 'string'
|
|
|
|
>y : string
|
|
|
|
>v2.x : string
|
|
|
|
>v2 : C<string>
|
|
|
|
>x : string
|
|
|
|
|
|
|
|
var u = v2.a; // should be 'string'
|
|
|
|
>u : string
|
|
|
|
>v2.a : string
|
|
|
|
>v2 : C<string>
|
|
|
|
>a : string
|
|
|
|
|
|
|
|
var z = v2.b;
|
|
|
|
>z : string
|
|
|
|
>v2.b : string
|
|
|
|
>v2 : C<string>
|
|
|
|
>b : string
|
|
|
|
|
|
|
|
|