2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures5.ts ===
|
|
|
|
// checking subtype relations for function types as it relates to contextual signature instantiation
|
|
|
|
// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain
|
|
|
|
|
|
|
|
class Base { foo: string; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>foo : string, Symbol(foo, Decl(subtypingWithConstructSignatures5.ts, 3, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
class Derived extends Base { bar: string; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>bar : string, Symbol(bar, Decl(subtypingWithConstructSignatures5.ts, 4, 28))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
class Derived2 extends Derived { baz: string; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>Derived2 : Derived2, Symbol(Derived2, Decl(subtypingWithConstructSignatures5.ts, 4, 43))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>baz : string, Symbol(baz, Decl(subtypingWithConstructSignatures5.ts, 5, 32))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
class OtherDerived extends Base { bing: string; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>OtherDerived : OtherDerived, Symbol(OtherDerived, Decl(subtypingWithConstructSignatures5.ts, 5, 47))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>bing : string, Symbol(bing, Decl(subtypingWithConstructSignatures5.ts, 6, 33))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
interface A { // T
|
2015-04-13 23:01:57 +02:00
|
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures5.ts, 6, 49))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// M's
|
|
|
|
a: new (x: number) => number[];
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : new (x: number) => number[], Symbol(a, Decl(subtypingWithConstructSignatures5.ts, 8, 13))
|
|
|
|
>x : number, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 10, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a2: new (x: number) => string[];
|
2015-04-13 23:01:57 +02:00
|
|
|
>a2 : new (x: number) => string[], Symbol(a2, Decl(subtypingWithConstructSignatures5.ts, 10, 35))
|
|
|
|
>x : number, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 11, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a3: new (x: number) => void;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a3 : new (x: number) => void, Symbol(a3, Decl(subtypingWithConstructSignatures5.ts, 11, 36))
|
|
|
|
>x : number, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 12, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a4: new (x: string, y: number) => string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a4 : new (x: string, y: number) => string, Symbol(a4, Decl(subtypingWithConstructSignatures5.ts, 12, 32))
|
|
|
|
>x : string, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 13, 13))
|
|
|
|
>y : number, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 13, 23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a5: new (x: (arg: string) => number) => string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a5 : new (x: (arg: string) => number) => string, Symbol(a5, Decl(subtypingWithConstructSignatures5.ts, 13, 45))
|
|
|
|
>x : (arg: string) => number, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 14, 13))
|
|
|
|
>arg : string, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 14, 17))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a6: new (x: (arg: Base) => Derived) => Base;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a6 : new (x: (arg: Base) => Derived) => Base, Symbol(a6, Decl(subtypingWithConstructSignatures5.ts, 14, 51))
|
|
|
|
>x : (arg: Base) => Derived, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 15, 13))
|
|
|
|
>arg : Base, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 15, 17))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a7 : new (x: (arg: Base) => Derived) => (r: Base) => Derived, Symbol(a7, Decl(subtypingWithConstructSignatures5.ts, 15, 48))
|
|
|
|
>x : (arg: Base) => Derived, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 16, 13))
|
|
|
|
>arg : Base, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 16, 17))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>r : Base, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 16, 44))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a8 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived, Symbol(a8, Decl(subtypingWithConstructSignatures5.ts, 16, 64))
|
|
|
|
>x : (arg: Base) => Derived, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 17, 13))
|
|
|
|
>arg : Base, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 17, 17))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>y : (arg2: Base) => Derived, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 17, 39))
|
|
|
|
>arg2 : Base, Symbol(arg2, Decl(subtypingWithConstructSignatures5.ts, 17, 44))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>r : Base, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 17, 72))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a9 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived, Symbol(a9, Decl(subtypingWithConstructSignatures5.ts, 17, 92))
|
|
|
|
>x : (arg: Base) => Derived, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 18, 13))
|
|
|
|
>arg : Base, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 18, 17))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>y : (arg2: Base) => Derived, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 18, 39))
|
|
|
|
>arg2 : Base, Symbol(arg2, Decl(subtypingWithConstructSignatures5.ts, 18, 44))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>r : Base, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 18, 72))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a10: new (...x: Derived[]) => Derived;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a10 : new (...x: Derived[]) => Derived, Symbol(a10, Decl(subtypingWithConstructSignatures5.ts, 18, 92))
|
|
|
|
>x : Derived[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 19, 14))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base, Symbol(a11, Decl(subtypingWithConstructSignatures5.ts, 19, 42))
|
|
|
|
>x : { foo: string; }, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 20, 14))
|
|
|
|
>foo : string, Symbol(foo, Decl(subtypingWithConstructSignatures5.ts, 20, 18))
|
|
|
|
>y : { foo: string; bar: string; }, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 20, 33))
|
|
|
|
>foo : string, Symbol(foo, Decl(subtypingWithConstructSignatures5.ts, 20, 38))
|
|
|
|
>bar : string, Symbol(bar, Decl(subtypingWithConstructSignatures5.ts, 20, 51))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a12 : new (x: Base[], y: Derived2[]) => Derived[], Symbol(a12, Decl(subtypingWithConstructSignatures5.ts, 20, 75))
|
|
|
|
>x : Base[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 21, 14))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>y : Derived2[], Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 21, 29))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived2 : Derived2, Symbol(Derived2, Decl(subtypingWithConstructSignatures5.ts, 4, 43))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a13: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a13 : new (x: Base[], y: Derived[]) => Derived[], Symbol(a13, Decl(subtypingWithConstructSignatures5.ts, 21, 68))
|
|
|
|
>x : Base[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 22, 14))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>y : Derived[], Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 22, 29))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a14: new (x: { a: string; b: number }) => Object;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a14 : new (x: { a: string; b: number; }) => Object, Symbol(a14, Decl(subtypingWithConstructSignatures5.ts, 22, 67))
|
|
|
|
>x : { a: string; b: number; }, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 23, 14))
|
|
|
|
>a : string, Symbol(a, Decl(subtypingWithConstructSignatures5.ts, 23, 18))
|
|
|
|
>b : number, Symbol(b, Decl(subtypingWithConstructSignatures5.ts, 23, 29))
|
|
|
|
>Object : Object, Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface B extends A {
|
2015-04-13 23:01:57 +02:00
|
|
|
>B : B, Symbol(B, Decl(subtypingWithConstructSignatures5.ts, 24, 1))
|
|
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures5.ts, 6, 49))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a: new <T>(x: T) => T[];
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : new <T>(x: T) => T[], Symbol(a, Decl(subtypingWithConstructSignatures5.ts, 26, 23))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 27, 12))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 27, 15))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 27, 12))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 27, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// S's
|
|
|
|
interface I extends B {
|
2015-04-13 23:01:57 +02:00
|
|
|
>I : I, Symbol(I, Decl(subtypingWithConstructSignatures5.ts, 28, 1))
|
|
|
|
>B : B, Symbol(B, Decl(subtypingWithConstructSignatures5.ts, 24, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// N's
|
|
|
|
a: new <T>(x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : new <T>(x: T) => T[], Symbol(a, Decl(subtypingWithConstructSignatures5.ts, 31, 23))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 33, 12))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 33, 15))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 33, 12))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 33, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a2: new <T>(x: T) => string[]; // ok
|
2015-04-13 23:01:57 +02:00
|
|
|
>a2 : new <T>(x: T) => string[], Symbol(a2, Decl(subtypingWithConstructSignatures5.ts, 33, 28))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 34, 13))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 34, 16))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 34, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a3: new <T>(x: T) => T; // ok since Base returns void
|
2015-04-13 23:01:57 +02:00
|
|
|
>a3 : new <T>(x: T) => T, Symbol(a3, Decl(subtypingWithConstructSignatures5.ts, 34, 34))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 35, 13))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 35, 16))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 35, 13))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 35, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a4: new <T, U>(x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number
|
2015-04-13 23:01:57 +02:00
|
|
|
>a4 : new <T, U>(x: T, y: U) => T, Symbol(a4, Decl(subtypingWithConstructSignatures5.ts, 35, 27))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 36, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 36, 15))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 36, 19))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 36, 13))
|
|
|
|
>y : U, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 36, 24))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 36, 15))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 36, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a5: new <T, U>(x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made
|
2015-04-13 23:01:57 +02:00
|
|
|
>a5 : new <T, U>(x: (arg: T) => U) => T, Symbol(a5, Decl(subtypingWithConstructSignatures5.ts, 36, 36))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 37, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 37, 15))
|
|
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 37, 19))
|
|
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 37, 23))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 37, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 37, 15))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 37, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a6: new <T extends Base, U extends Derived>(x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy
|
2015-04-13 23:01:57 +02:00
|
|
|
>a6 : new <T extends Base, U extends Derived>(x: (arg: T) => U) => T, Symbol(a6, Decl(subtypingWithConstructSignatures5.ts, 37, 42))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 38, 13))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 38, 28))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 38, 48))
|
|
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 38, 52))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 38, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 38, 28))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 38, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a7: new <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U; // ok
|
2015-04-13 23:01:57 +02:00
|
|
|
>a7 : new <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U, Symbol(a7, Decl(subtypingWithConstructSignatures5.ts, 38, 71))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 39, 13))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 39, 28))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 39, 48))
|
|
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 39, 52))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 39, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 39, 28))
|
|
|
|
>r : T, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 39, 70))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 39, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 39, 28))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok
|
2015-04-13 23:01:57 +02:00
|
|
|
>a8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U, Symbol(a8, Decl(subtypingWithConstructSignatures5.ts, 39, 81))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 40, 13))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 40, 28))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 40, 48))
|
|
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 40, 52))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 40, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 40, 28))
|
|
|
|
>y : (arg2: T) => U, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 40, 65))
|
|
|
|
>arg2 : T, Symbol(arg2, Decl(subtypingWithConstructSignatures5.ts, 40, 70))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 40, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 40, 28))
|
|
|
|
>r : T, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 40, 89))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 40, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 40, 28))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
|
2015-04-13 23:01:57 +02:00
|
|
|
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U, Symbol(a9, Decl(subtypingWithConstructSignatures5.ts, 40, 100))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 41, 13))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 41, 28))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 41, 48))
|
|
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures5.ts, 41, 52))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 41, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 41, 28))
|
|
|
|
>y : (arg2: { foo: string; bing: number; }) => U, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 41, 65))
|
|
|
|
>arg2 : { foo: string; bing: number; }, Symbol(arg2, Decl(subtypingWithConstructSignatures5.ts, 41, 70))
|
|
|
|
>foo : string, Symbol(foo, Decl(subtypingWithConstructSignatures5.ts, 41, 77))
|
|
|
|
>bing : number, Symbol(bing, Decl(subtypingWithConstructSignatures5.ts, 41, 90))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 41, 28))
|
|
|
|
>r : T, Symbol(r, Decl(subtypingWithConstructSignatures5.ts, 41, 117))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 41, 13))
|
|
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures5.ts, 41, 28))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a10: new <T extends Derived>(...x: T[]) => T; // ok
|
2015-04-13 23:01:57 +02:00
|
|
|
>a10 : new <T extends Derived>(...x: T[]) => T, Symbol(a10, Decl(subtypingWithConstructSignatures5.ts, 41, 128))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 42, 14))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : T[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 42, 33))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 42, 14))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 42, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a11: new <T extends Base>(x: T, y: T) => T; // ok
|
2015-04-13 23:01:57 +02:00
|
|
|
>a11 : new <T extends Base>(x: T, y: T) => T, Symbol(a11, Decl(subtypingWithConstructSignatures5.ts, 42, 49))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 43, 14))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 43, 30))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 43, 14))
|
|
|
|
>y : T, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 43, 35))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 43, 14))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 43, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific parameter type
|
2015-04-13 23:01:57 +02:00
|
|
|
>a12 : new <T extends Base[]>(x: Base[], y: T) => Derived[], Symbol(a12, Decl(subtypingWithConstructSignatures5.ts, 43, 47))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 44, 14))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>x : Base[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 44, 37))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>y : T, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 44, 52))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 44, 14))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies constraint, contextual signature instantiation succeeds
|
2015-04-13 23:01:57 +02:00
|
|
|
>a13 : new <T extends Derived[]>(x: Base[], y: T) => T, Symbol(a13, Decl(subtypingWithConstructSignatures5.ts, 44, 77))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 45, 14))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures5.ts, 3, 27))
|
|
|
|
>x : Base[], Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 45, 40))
|
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures5.ts, 0, 0))
|
|
|
|
>y : T, Symbol(y, Decl(subtypingWithConstructSignatures5.ts, 45, 55))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 45, 14))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 45, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
a14: new <T>(x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature
|
2015-04-13 23:01:57 +02:00
|
|
|
>a14 : new <T>(x: { a: T; b: T; }) => T, Symbol(a14, Decl(subtypingWithConstructSignatures5.ts, 45, 67))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 46, 14))
|
|
|
|
>x : { a: T; b: T; }, Symbol(x, Decl(subtypingWithConstructSignatures5.ts, 46, 17))
|
|
|
|
>a : T, Symbol(a, Decl(subtypingWithConstructSignatures5.ts, 46, 21))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 46, 14))
|
|
|
|
>b : T, Symbol(b, Decl(subtypingWithConstructSignatures5.ts, 46, 27))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 46, 14))
|
|
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures5.ts, 46, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|