2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/generics2NoError.ts ===
|
|
|
|
interface A { a: string; }
|
|
|
|
>A : A
|
|
|
|
>a : string
|
|
|
|
|
|
|
|
interface B extends A { b: string; }
|
|
|
|
>B : B
|
|
|
|
>A : A
|
|
|
|
>b : string
|
|
|
|
|
|
|
|
interface C extends B { c: string; }
|
|
|
|
>C : C
|
|
|
|
>B : B
|
|
|
|
>c : string
|
|
|
|
|
|
|
|
interface G<T, U extends B> {
|
|
|
|
>G : G<T, U>
|
|
|
|
>T : T
|
|
|
|
>U : U
|
|
|
|
>B : B
|
|
|
|
|
|
|
|
x: T;
|
|
|
|
>x : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
y: U;
|
|
|
|
>y : U
|
|
|
|
>U : U
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var v1: {
|
|
|
|
>v1 : { x: { a: string; }; y: { a: string; b: string; c: string; }; }
|
|
|
|
|
|
|
|
x: { a: string; }
|
|
|
|
>x : { a: string; }
|
|
|
|
>a : string
|
|
|
|
|
|
|
|
y: { a: string; b: string; c: string };
|
|
|
|
>y : { a: string; b: string; c: string; }
|
|
|
|
>a : string
|
|
|
|
>b : string
|
|
|
|
>c : string
|
|
|
|
|
|
|
|
}; // Ok
|
|
|
|
|
|
|
|
|
|
|
|
var v2: G<{ a: string }, C>; // Ok, equivalent to G<A, C>
|
|
|
|
>v2 : G<{ a: string; }, C>
|
2014-08-19 04:56:03 +02:00
|
|
|
>G : G<T, U>
|
2014-08-15 23:33:16 +02:00
|
|
|
>a : string
|
|
|
|
>C : C
|
|
|
|
|
|
|
|
var v4: G<G<A, B>, C>; // Ok
|
|
|
|
>v4 : G<G<A, B>, C>
|
2014-08-19 04:56:03 +02:00
|
|
|
>G : G<T, U>
|
|
|
|
>G : G<T, U>
|
2014-08-15 23:33:16 +02:00
|
|
|
>A : A
|
|
|
|
>B : B
|
|
|
|
>C : C
|
|
|
|
|