2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.ts ===
|
|
|
|
// no errors expected
|
|
|
|
|
|
|
|
class C<T extends Date> {
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : C<T>, Symbol(C, Decl(wrappedAndRecursiveConstraints.ts, 0, 0))
|
|
|
|
>T : T, Symbol(T, Decl(wrappedAndRecursiveConstraints.ts, 2, 8))
|
|
|
|
>Date : Date, Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(public data: T) { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>data : T, Symbol(data, Decl(wrappedAndRecursiveConstraints.ts, 3, 16))
|
|
|
|
>T : T, Symbol(T, Decl(wrappedAndRecursiveConstraints.ts, 2, 8))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
foo<U extends T>(x: U) {
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : <U extends T>(x: U) => U, Symbol(foo, Decl(wrappedAndRecursiveConstraints.ts, 3, 35))
|
|
|
|
>U : U, Symbol(U, Decl(wrappedAndRecursiveConstraints.ts, 4, 8))
|
|
|
|
>T : T, Symbol(T, Decl(wrappedAndRecursiveConstraints.ts, 2, 8))
|
|
|
|
>x : U, Symbol(x, Decl(wrappedAndRecursiveConstraints.ts, 4, 21))
|
|
|
|
>U : U, Symbol(U, Decl(wrappedAndRecursiveConstraints.ts, 4, 8))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return x;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : U, Symbol(x, Decl(wrappedAndRecursiveConstraints.ts, 4, 21))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Foo extends Date {
|
2015-04-13 23:01:57 +02:00
|
|
|
>Foo : Foo, Symbol(Foo, Decl(wrappedAndRecursiveConstraints.ts, 7, 1))
|
|
|
|
>Date : Date, Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
foo: string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : string, Symbol(foo, Decl(wrappedAndRecursiveConstraints.ts, 9, 28))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var y: Foo = null;
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : Foo, Symbol(y, Decl(wrappedAndRecursiveConstraints.ts, 13, 3))
|
|
|
|
>Foo : Foo, Symbol(Foo, Decl(wrappedAndRecursiveConstraints.ts, 7, 1))
|
2015-04-13 21:36:11 +02:00
|
|
|
>null : null
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var c = new C(y);
|
2015-04-13 23:01:57 +02:00
|
|
|
>c : C<Foo>, Symbol(c, Decl(wrappedAndRecursiveConstraints.ts, 14, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>new C(y) : C<Foo>
|
2015-04-13 23:01:57 +02:00
|
|
|
>C : typeof C, Symbol(C, Decl(wrappedAndRecursiveConstraints.ts, 0, 0))
|
|
|
|
>y : Foo, Symbol(y, Decl(wrappedAndRecursiveConstraints.ts, 13, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r = c.foo(y);
|
2015-04-13 23:01:57 +02:00
|
|
|
>r : Foo, Symbol(r, Decl(wrappedAndRecursiveConstraints.ts, 15, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>c.foo(y) : Foo
|
2015-04-13 23:01:57 +02:00
|
|
|
>c.foo : <U extends Foo>(x: U) => U, Symbol(C.foo, Decl(wrappedAndRecursiveConstraints.ts, 3, 35))
|
|
|
|
>c : C<Foo>, Symbol(c, Decl(wrappedAndRecursiveConstraints.ts, 14, 3))
|
|
|
|
>foo : <U extends Foo>(x: U) => U, Symbol(C.foo, Decl(wrappedAndRecursiveConstraints.ts, 3, 35))
|
|
|
|
>y : Foo, Symbol(y, Decl(wrappedAndRecursiveConstraints.ts, 13, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|