TypeScript/tests/baselines/reference/generics3.types

31 lines
395 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/generics3.ts ===
class C<T> { private x: T; }
>C : C<T>
>T : T
>x : T
>T : T
2014-08-15 23:33:16 +02:00
interface X { f(): string; }
>X : X
>f : () => string
2014-08-15 23:33:16 +02:00
interface Y { f(): string; }
>Y : Y
>f : () => string
2014-08-15 23:33:16 +02:00
var a: C<X>;
>a : C<X>
>C : C<T>
>X : X
2014-08-15 23:33:16 +02:00
var b: C<Y>;
>b : C<Y>
>C : C<T>
>Y : Y
2014-08-15 23:33:16 +02:00
a = b; // Ok - should be identical
>a = b : C<Y>
>a : C<X>
>b : C<Y>
2014-08-15 23:33:16 +02:00