TypeScript/tests/baselines/reference/genericClasses1.types

22 lines
309 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/genericClasses1.ts ===
class C<T> {
>C : C<T>
>T : T
2014-08-15 23:33:16 +02:00
public x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
}
var v1 = new C<string>();
>v1 : C<string>
2014-08-15 23:33:16 +02:00
>new C<string>() : C<string>
>C : typeof C
2014-08-15 23:33:16 +02:00
var y = v1.x; // should be 'string'
>y : string
>v1.x : string
>v1 : C<string>
>x : string
2014-08-15 23:33:16 +02:00