32 lines
479 B
Text
32 lines
479 B
Text
=== tests/cases/compiler/typeParameterConstrainedToOuterTypeParameter.ts ===
|
|
interface A<T> {
|
|
>A : A<T>
|
|
>T : T
|
|
|
|
<U extends T>(x: U[])
|
|
>U : U
|
|
>T : T
|
|
>x : U[]
|
|
>U : U
|
|
}
|
|
|
|
interface B<T> {
|
|
>B : B<T>
|
|
>T : T
|
|
|
|
<U extends T>(x: U)
|
|
>U : U
|
|
>T : T
|
|
>x : U
|
|
>U : U
|
|
}
|
|
|
|
var a: A<string>
|
|
>a : A<string>
|
|
>A : A<T>
|
|
|
|
var b: B<string> = a; // assignment should be legal (both U's get instantiated to any for comparison)
|
|
>b : B<string>
|
|
>B : B<T>
|
|
>a : A<string>
|
|
|