51 lines
749 B
Plaintext
51 lines
749 B
Plaintext
=== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.ts ===
|
|
// no errors expected
|
|
|
|
class C<T extends Date> {
|
|
>C : C<T>
|
|
>T : T
|
|
>Date : Date
|
|
|
|
constructor(public data: T) { }
|
|
>data : T
|
|
>T : T
|
|
|
|
foo<U extends T>(x: U) {
|
|
>foo : <U extends T>(x: U) => U
|
|
>U : U
|
|
>T : T
|
|
>x : U
|
|
>U : U
|
|
|
|
return x;
|
|
>x : U
|
|
}
|
|
}
|
|
|
|
interface Foo extends Date {
|
|
>Foo : Foo
|
|
>Date : Date
|
|
|
|
foo: string;
|
|
>foo : string
|
|
}
|
|
|
|
var y: Foo = null;
|
|
>y : Foo
|
|
>Foo : Foo
|
|
|
|
var c = new C(y);
|
|
>c : C<Foo>
|
|
>new C(y) : C<Foo>
|
|
>C : typeof C
|
|
>y : Foo
|
|
|
|
var r = c.foo(y);
|
|
>r : Foo
|
|
>c.foo(y) : Foo
|
|
>c.foo : <U extends Foo>(x: U) => U
|
|
>c : C<Foo>
|
|
>foo : <U extends Foo>(x: U) => U
|
|
>y : Foo
|
|
|