>foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }; (a2: any): any; }
>a2 : { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }
// type of parameter is overload set which means we can't do inference based on this type
new (x: {
>x : { new (a: number): number; new (a?: number): number; }
new (a: number): number;
>a : number
new (a?: number): number;
>a : number
}): number[];
new (x: {
>x : { new (a: boolean): boolean; new (a?: boolean): boolean; }
new (a: boolean): boolean;
>a : boolean
new (a?: boolean): boolean;
>a : boolean
}): boolean[];
}): typeof a2;
>a2 : { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }
declare function foo16(a2: any): any;
>foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }; (a2: any): any; }
>a2 : any
declare function foo17(a2: {
>foo17 : { (a2: { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }): { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }; (a2: any): any; }
>a2 : { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }
new (x: {
>x : { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }
new <T extends Derived>(a: T): T;
>T : T
>Derived : Derived
>a : T
>T : T
>T : T
new <T extends Base>(a: T): T;
>T : T
>Base : Base
>a : T
>T : T
>T : T
}): any[];
new (x: {
>x : { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }
new <T extends Derived2>(a: T): T;
>T : T
>Derived2 : Derived2
>a : T
>T : T
>T : T
new <T extends Base>(a: T): T;
>T : T
>Base : Base
>a : T
>T : T
>T : T
}): any[];
}): typeof a2;
>a2 : { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }
declare function foo17(a2: any): any;
>foo17 : { (a2: { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }): { new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }; (a2: any): any; }
>a2 : any
var r1arg1: new <T, U>(x: T) => U[];
>r1arg1 : new <T, U>(x: T) => U[]
>T : T
>U : U
>x : T
>T : T
>U : U
var r1arg2: new (x: number) => string[];
>r1arg2 : new (x: number) => string[]
>x : number
var r1 = foo2(r1arg1); // any
>r1 : any
>foo2(r1arg1) : any
>foo2 : { (a2: new (x: number) => string[]): new (x: number) => string[]; (a2: any): any; }
>r1arg1 : new <T, U>(x: T) => U[]
var r1a = [r1arg2, r1arg1];
>r1a : { new <T, U>(x: T): U[]; }[]
>[r1arg2, r1arg1] : { new <T, U>(x: T): U[]; }[]
>r1arg2 : new (x: number) => string[]
>r1arg1 : new <T, U>(x: T) => U[]
var r1b = [r1arg1, r1arg2];
>r1b : { new <T, U>(x: T): U[]; }[]
>[r1arg1, r1arg2] : { new <T, U>(x: T): U[]; }[]
>r1arg1 : new <T, U>(x: T) => U[]
>r1arg2 : new (x: number) => string[]
var r2arg1: new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V;
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
>T : T
>Base : Base
>U : U
>Derived : Derived
>V : V
>Derived2 : Derived2
>x : new (arg: T) => U
>arg : T
>T : T
>U : U
>r : T
>T : T
>V : V
var r2arg2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2;
>r2arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2
>x : new (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>r : Base
>Base : Base
>Derived2 : Derived2
var r2 = foo7(r2arg1); // any
>r2 : any
>foo7(r2arg1) : any
>foo7 : { (a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2; (a2: any): any; }
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
var r2a = [r2arg2, r2arg1];
>r2a : { new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U): new (r: T) => V; }[]
>[r2arg2, r2arg1] : { new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U): new (r: T) => V; }[]
>r2arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
var r2b = [r2arg1, r2arg2];
>r2b : { new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U): new (r: T) => V; }[]
>[r2arg1, r2arg2] : { new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U): new (r: T) => V; }[]
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
>r2arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2
var r3arg1: new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U;
>r3arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U
>T : T
>Base : Base
>U : U
>Derived : Derived
>x : new (arg: T) => U
>arg : T
>T : T
>U : U
>y : (arg2: { foo: number; }) => U
>arg2 : { foo: number; }
>foo : number
>U : U
>r : T
>T : T
>U : U
var r3arg2: new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived;
>r3arg2 : new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>x : (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>y : new (arg2: Base) => Derived
>arg2 : Base
>Base : Base
>Derived : Derived
>r : Base
>Base : Base
>Derived : Derived
var r3 = foo8(r3arg1); // any
>r3 : any
>foo8(r3arg1) : any
>foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived; (a2: any): any; }
>r3arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U