2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/generics0.ts ===
|
|
|
|
interface G<T> {
|
|
|
|
>G : G<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
x: T;
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
var v2: G<string>;
|
|
|
|
>v2 : G<string>
|
2014-08-19 04:56:03 +02:00
|
|
|
>G : G<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var z = v2.x; // 'y' should be of type 'string'
|
|
|
|
>z : string
|
|
|
|
>v2.x : string
|
|
|
|
>v2 : G<string>
|
|
|
|
>x : string
|
|
|
|
|