=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures2.ts ===
// checking subtype relations for function types as it relates to contextual signature instantiation

class Base { foo: string; }
>Base : Base
>foo : string

class Derived extends Base { bar: string; }
>Derived : Derived
>Base : Base
>bar : string

class Derived2 extends Derived { baz: string; }
>Derived2 : Derived2
>Derived : Derived
>baz : string

class OtherDerived extends Base { bing: string; }
>OtherDerived : OtherDerived
>Base : Base
>bing : string

declare function foo1(a: new (x: number) => number[]): typeof a;
>foo1 : { (a: new (x: number) => number[]): new (x: number) => number[]; (a: any): any; }
>a : new (x: number) => number[]
>x : number
>a : new (x: number) => number[]

declare function foo1(a: any): any;
>foo1 : { (a: new (x: number) => number[]): new (x: number) => number[]; (a: any): any; }
>a : any

declare function foo2(a: new (x: number) => string[]): typeof a;
>foo2 : { (a: new (x: number) => string[]): new (x: number) => string[]; (a: any): any; }
>a : new (x: number) => string[]
>x : number
>a : new (x: number) => string[]

declare function foo2(a: any): any;
>foo2 : { (a: new (x: number) => string[]): new (x: number) => string[]; (a: any): any; }
>a : any

declare function foo3(a: new (x: number) => void): typeof a;
>foo3 : { (a: new (x: number) => void): new (x: number) => void; (a: any): any; }
>a : new (x: number) => void
>x : number
>a : new (x: number) => void

declare function foo3(a: any): any;
>foo3 : { (a: new (x: number) => void): new (x: number) => void; (a: any): any; }
>a : any

declare function foo4(a: new (x: string, y: number) => string): typeof a;
>foo4 : { (a: new (x: string, y: number) => string): new (x: string, y: number) => string; (a: any): any; }
>a : new (x: string, y: number) => string
>x : string
>y : number
>a : new (x: string, y: number) => string

declare function foo4(a: any): any;
>foo4 : { (a: new (x: string, y: number) => string): new (x: string, y: number) => string; (a: any): any; }
>a : any

declare function foo5(a: new (x: new (arg: string) => number) => string): typeof a;
>foo5 : { (a: new (x: new (arg: string) => number) => string): new (x: new (arg: string) => number) => string; (a: any): any; }
>a : new (x: new (arg: string) => number) => string
>x : new (arg: string) => number
>arg : string
>a : new (x: new (arg: string) => number) => string

declare function foo5(a: any): any;
>foo5 : { (a: new (x: new (arg: string) => number) => string): new (x: new (arg: string) => number) => string; (a: any): any; }
>a : any

declare function foo6(a: new (x: new (arg: Base) => Derived) => Base): typeof a;
>foo6 : { (a: new (x: new (arg: Base) => Derived) => Base): new (x: new (arg: Base) => Derived) => Base; (a: any): any; }
>a : new (x: new (arg: Base) => Derived) => Base
>x : new (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>Base : Base
>a : new (x: new (arg: Base) => Derived) => Base

declare function foo6(a: any): any;
>foo6 : { (a: new (x: new (arg: Base) => Derived) => Base): new (x: new (arg: Base) => Derived) => Base; (a: any): any; }
>a : any

declare function foo7(a: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived): typeof a;
>foo7 : { (a: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived): new (x: new (arg: Base) => Derived) => new (r: Base) => Derived; (a: any): any; }
>a : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived
>x : new (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>r : Base
>Base : Base
>Derived : Derived
>a : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived

declare function foo7(a: any): any;
>foo7 : { (a: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived): new (x: new (arg: Base) => Derived) => new (r: Base) => Derived; (a: any): any; }
>a : any

declare function foo8(a: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a;
>foo8 : { (a: 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; (a: any): any; }
>a : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>x : new (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
>a : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived

declare function foo8(a: any): any;
>foo8 : { (a: 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; (a: any): any; }
>a : any

declare function foo9(a: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a;
>foo9 : { (a: 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; (a: any): any; }
>a : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>x : new (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
>a : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived

declare function foo9(a: any): any;
>foo9 : { (a: 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; (a: any): any; }
>a : any

declare function foo10(a: new (...x: Derived[]) => Derived): typeof a;
>foo10 : { (a: new (...x: Derived[]) => Derived): new (...x: Derived[]) => Derived; (a: any): any; }
>a : new (...x: Derived[]) => Derived
>x : Derived[]
>Derived : Derived
>Derived : Derived
>a : new (...x: Derived[]) => Derived

declare function foo10(a: any): any;
>foo10 : { (a: new (...x: Derived[]) => Derived): new (...x: Derived[]) => Derived; (a: any): any; }
>a : any

declare function foo11(a: new (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a;
>foo11 : { (a: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base; (a: any): any; }
>a : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
>foo : string
>bar : string
>Base : Base
>a : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base

declare function foo11(a: any): any;
>foo11 : { (a: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base; (a: any): any; }
>a : any

declare function foo12(a: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>): typeof a;
>foo12 : { (a: new (x: Base[], y: Derived2[]) => Derived[]): new (x: Base[], y: Derived2[]) => Derived[]; (a: any): any; }
>a : new (x: Base[], y: Derived2[]) => Derived[]
>x : Base[]
>Array : T[]
>Base : Base
>y : Derived2[]
>Array : T[]
>Derived2 : Derived2
>Array : T[]
>Derived : Derived
>a : new (x: Base[], y: Derived2[]) => Derived[]

declare function foo12(a: any): any;
>foo12 : { (a: new (x: Base[], y: Derived2[]) => Derived[]): new (x: Base[], y: Derived2[]) => Derived[]; (a: any): any; }
>a : any

declare function foo13(a: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>): typeof a;
>foo13 : { (a: new (x: Base[], y: Derived[]) => Derived[]): new (x: Base[], y: Derived[]) => Derived[]; (a: any): any; }
>a : new (x: Base[], y: Derived[]) => Derived[]
>x : Base[]
>Array : T[]
>Base : Base
>y : Derived[]
>Array : T[]
>Derived : Derived
>Array : T[]
>Derived : Derived
>a : new (x: Base[], y: Derived[]) => Derived[]

declare function foo13(a: any): any;
>foo13 : { (a: new (x: Base[], y: Derived[]) => Derived[]): new (x: Base[], y: Derived[]) => Derived[]; (a: any): any; }
>a : any

declare function foo14(a: new (x: { a: string; b: number }) => Object): typeof a;
>foo14 : { (a: new (x: { a: string; b: number; }) => Object): new (x: { a: string; b: number; }) => Object; (a: any): any; }
>a : new (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
>Object : Object
>a : new (x: { a: string; b: number; }) => Object

declare function foo14(a: any): any;
>foo14 : { (a: new (x: { a: string; b: number; }) => Object): new (x: { a: string; b: number; }) => Object; (a: any): any; }
>a : any

declare function foo15(a: { 
>foo15 : { (a: { new (x: number): number[]; new (x: string): string[]; }): { new (x: number): number[]; new (x: string): string[]; }; (a: any): any; }
>a : { new (x: number): number[]; new (x: string): string[]; }

    new (x: number): number[];
>x : number

    new (x: string): string[]; 
>x : string

}): typeof a;
>a : { new (x: number): number[]; new (x: string): string[]; }

declare function foo15(a: any): any;
>foo15 : { (a: { new (x: number): number[]; new (x: string): string[]; }): { new (x: number): number[]; new (x: string): string[]; }; (a: any): any; }
>a : any

declare function foo16(a: {
>foo16 : { (a: { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }): { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }; (a: any): any; }
>a : { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }

    new <T extends Derived>(x: T): number[];
>T : T
>Derived : Derived
>x : T
>T : T

    new <U extends Base>(x: U): number[];
>U : U
>Base : Base
>x : U
>U : U

}): typeof a;
>a : { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }

declare function foo16(a: any): any;
>foo16 : { (a: { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }): { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }; (a: any): any; }
>a : any

declare function foo17(a: {
>foo17 : { (a: { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }): { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }; (a: any): any; }
>a : { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }

    new (x: (a: number) => number): number[];
>x : (a: number) => number
>a : number

    new (x: (a: string) => string): string[];
>x : (a: string) => string
>a : string

}): typeof a;
>a : { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }

declare function foo17(a: any): any;
>foo17 : { (a: { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }): { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }; (a: any): any; }
>a : any

declare function foo18(a: {
>foo18 : { (a: { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }): { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }; (a: any): any; }
>a : { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }

    new (x: {
>x : { new (a: number): number; new (a: string): string; }

        new (a: number): number;
>a : number

        new (a: string): string;
>a : string

    }): any[];
    new (x: {
>x : { new (a: boolean): boolean; new (a: Date): Date; }

        new (a: boolean): boolean;
>a : boolean

        new (a: Date): Date;
>a : Date
>Date : Date
>Date : Date

    }): any[];
}): typeof a;
>a : { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }

declare function foo18(a: any): any;
>foo18 : { (a: { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }): { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }; (a: any): any; }
>a : any

var r1arg1: new <T>(x: T) => T[];
>r1arg1 : new <T>(x: T) => T[]
>T : T
>x : T
>T : T
>T : T

var r1arg2: new (x: number) => number[];
>r1arg2 : new (x: number) => number[]
>x : number

var r1 = foo1(r1arg1); // any, return types are not subtype of first overload
>r1 : any
>foo1(r1arg1) : any
>foo1 : { (a: new (x: number) => number[]): new (x: number) => number[]; (a: any): any; }
>r1arg1 : new <T>(x: T) => T[]

var r1a = [r1arg2, r1arg1]; // generic signature, subtype in both directions
>r1a : { new <T>(x: T): T[]; }[]
>[r1arg2, r1arg1] : { new <T>(x: T): T[]; }[]
>r1arg2 : new (x: number) => number[]
>r1arg1 : new <T>(x: T) => T[]

var r1b = [r1arg1, r1arg2]; // generic signature, subtype in both directions
>r1b : { new <T>(x: T): T[]; }[]
>[r1arg1, r1arg2] : { new <T>(x: T): T[]; }[]
>r1arg1 : new <T>(x: T) => T[]
>r1arg2 : new (x: number) => number[]

var r2arg1: new <T>(x: T) => string[];
>r2arg1 : new <T>(x: T) => string[]
>T : T
>x : T
>T : T

var r2arg2: new (x: number) => string[];
>r2arg2 : new (x: number) => string[]
>x : number

var r2 = foo2(r2arg1);
>r2 : new (x: number) => string[]
>foo2(r2arg1) : new (x: number) => string[]
>foo2 : { (a: new (x: number) => string[]): new (x: number) => string[]; (a: any): any; }
>r2arg1 : new <T>(x: T) => string[]

var r2a = [r2arg1, r2arg2];
>r2a : { new <T>(x: T): string[]; }[]
>[r2arg1, r2arg2] : { new <T>(x: T): string[]; }[]
>r2arg1 : new <T>(x: T) => string[]
>r2arg2 : new (x: number) => string[]

var r2b = [r2arg2, r2arg1];
>r2b : { new (x: number): string[]; }[]
>[r2arg2, r2arg1] : { new (x: number): string[]; }[]
>r2arg2 : new (x: number) => string[]
>r2arg1 : new <T>(x: T) => string[]

var r3arg1: new <T>(x: T) => T;
>r3arg1 : new <T>(x: T) => T
>T : T
>x : T
>T : T
>T : T

var r3arg2: new (x: number) => void;
>r3arg2 : new (x: number) => void
>x : number

var r3 = foo3(r3arg1);
>r3 : new (x: number) => void
>foo3(r3arg1) : new (x: number) => void
>foo3 : { (a: new (x: number) => void): new (x: number) => void; (a: any): any; }
>r3arg1 : new <T>(x: T) => T

var r3a = [r3arg1, r3arg2];
>r3a : { new <T>(x: T): T; }[]
>[r3arg1, r3arg2] : { new <T>(x: T): T; }[]
>r3arg1 : new <T>(x: T) => T
>r3arg2 : new (x: number) => void

var r3b = [r3arg2, r3arg1];
>r3b : { new (x: number): void; }[]
>[r3arg2, r3arg1] : { new (x: number): void; }[]
>r3arg2 : new (x: number) => void
>r3arg1 : new <T>(x: T) => T

var r4arg1: new <T, U>(x: T, y: U) => T;
>r4arg1 : new <T, U>(x: T, y: U) => T
>T : T
>U : U
>x : T
>T : T
>y : U
>U : U
>T : T

var r4arg2: new (x: string, y: number) => string;
>r4arg2 : new (x: string, y: number) => string
>x : string
>y : number

var r4 = foo4(r4arg1); // any
>r4 : any
>foo4(r4arg1) : any
>foo4 : { (a: new (x: string, y: number) => string): new (x: string, y: number) => string; (a: any): any; }
>r4arg1 : new <T, U>(x: T, y: U) => T

var r4a = [r4arg1, r4arg2];
>r4a : { new <T, U>(x: T, y: U): T; }[]
>[r4arg1, r4arg2] : { new <T, U>(x: T, y: U): T; }[]
>r4arg1 : new <T, U>(x: T, y: U) => T
>r4arg2 : new (x: string, y: number) => string

var r4b = [r4arg2, r4arg1];
>r4b : { new <T, U>(x: T, y: U): T; }[]
>[r4arg2, r4arg1] : { new <T, U>(x: T, y: U): T; }[]
>r4arg2 : new (x: string, y: number) => string
>r4arg1 : new <T, U>(x: T, y: U) => T

var r5arg1: new <T, U>(x: new (arg: T) => U) => T;
>r5arg1 : new <T, U>(x: new (arg: T) => U) => T
>T : T
>U : U
>x : new (arg: T) => U
>arg : T
>T : T
>U : U
>T : T

var r5arg2: new (x: new (arg: string) => number) => string;
>r5arg2 : new (x: new (arg: string) => number) => string
>x : new (arg: string) => number
>arg : string

var r5 = foo5(r5arg1); // any
>r5 : any
>foo5(r5arg1) : any
>foo5 : { (a: new (x: new (arg: string) => number) => string): new (x: new (arg: string) => number) => string; (a: any): any; }
>r5arg1 : new <T, U>(x: new (arg: T) => U) => T

var r5a = [r5arg1, r5arg2];
>r5a : { new <T, U>(x: new (arg: T) => U): T; }[]
>[r5arg1, r5arg2] : { new <T, U>(x: new (arg: T) => U): T; }[]
>r5arg1 : new <T, U>(x: new (arg: T) => U) => T
>r5arg2 : new (x: new (arg: string) => number) => string

var r5b = [r5arg2, r5arg1];
>r5b : { new <T, U>(x: new (arg: T) => U): T; }[]
>[r5arg2, r5arg1] : { new <T, U>(x: new (arg: T) => U): T; }[]
>r5arg2 : new (x: new (arg: string) => number) => string
>r5arg1 : new <T, U>(x: new (arg: T) => U) => T

var r6arg1: new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T;
>r6arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T
>T : T
>Base : Base
>U : U
>Derived : Derived
>x : new (arg: T) => U
>arg : T
>T : T
>U : U
>T : T

var r6arg2: new (x: new (arg: Base) => Derived) => Base;
>r6arg2 : new (x: new (arg: Base) => Derived) => Base
>x : new (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>Base : Base

var r6 = foo6(r6arg1); // any
>r6 : any
>foo6(r6arg1) : any
>foo6 : { (a: new (x: new (arg: Base) => Derived) => Base): new (x: new (arg: Base) => Derived) => Base; (a: any): any; }
>r6arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T

var r6a = [r6arg1, r6arg2];
>r6a : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): T; }[]
>[r6arg1, r6arg2] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): T; }[]
>r6arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T
>r6arg2 : new (x: new (arg: Base) => Derived) => Base

var r6b = [r6arg2, r6arg1];
>r6b : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): T; }[]
>[r6arg2, r6arg1] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): T; }[]
>r6arg2 : new (x: new (arg: Base) => Derived) => Base
>r6arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T

var r7arg1: new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U;
>r7arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U
>T : T
>Base : Base
>U : U
>Derived : Derived
>x : new (arg: T) => U
>arg : T
>T : T
>U : U
>r : T
>T : T
>U : U

var r7arg2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived;
>r7arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived
>x : new (arg: Base) => Derived
>arg : Base
>Base : Base
>Derived : Derived
>r : Base
>Base : Base
>Derived : Derived

var r7 = foo7(r7arg1); // any
>r7 : any
>foo7(r7arg1) : any
>foo7 : { (a: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived): new (x: new (arg: Base) => Derived) => new (r: Base) => Derived; (a: any): any; }
>r7arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U

var r7a = [r7arg1, r7arg2];
>r7a : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): new (r: T) => U; }[]
>[r7arg1, r7arg2] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): new (r: T) => U; }[]
>r7arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U
>r7arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived

var r7b = [r7arg2, r7arg1];
>r7b : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): new (r: T) => U; }[]
>[r7arg2, r7arg1] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U): new (r: T) => U; }[]
>r7arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived
>r7arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U

var r8arg1: new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U;
>r8arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => 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 : new (arg2: T) => U
>arg2 : T
>T : T
>U : U
>r : T
>T : T
>U : U

var r8arg2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived;
>r8arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>x : new (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 r8 = foo8(r8arg1); // any
>r8 : any
>foo8(r8arg1) : any
>foo8 : { (a: 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; (a: any): any; }
>r8arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U

var r8a = [r8arg1, r8arg2];
>r8a : { new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U): new (r: T) => U; }[]
>[r8arg1, r8arg2] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U): new (r: T) => U; }[]
>r8arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U
>r8arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived

var r8b = [r8arg2, r8arg1];
>r8b : { new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U): new (r: T) => U; }[]
>[r8arg2, r8arg1] : { new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U): new (r: T) => U; }[]
>r8arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>r8arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U

var r9arg1: new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => new (r: T) => U;
>r9arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: 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: string; bing: number; }) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
>U : U
>r : T
>T : T
>U : U

var r9arg2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived;
>r9arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>x : new (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 r9 = foo9(r9arg1); // any
>r9 : any
>foo9(r9arg1) : any
>foo9 : { (a: 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; (a: any): any; }
>r9arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U

var r9a = [r9arg1, r9arg2];
>r9a : {}[]
>[r9arg1, r9arg2] : {}[]
>r9arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U
>r9arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived

var r9b = [r9arg2, r9arg1];
>r9b : {}[]
>[r9arg2, r9arg1] : {}[]
>r9arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>r9arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U

var r10arg1: new <T extends Derived>(...x: T[]) => T;
>r10arg1 : new <T extends Derived>(...x: T[]) => T
>T : T
>Derived : Derived
>x : T[]
>T : T
>T : T

var r10arg2: new (...x: Derived[]) => Derived;
>r10arg2 : new (...x: Derived[]) => Derived
>x : Derived[]
>Derived : Derived
>Derived : Derived

var r10 = foo10(r10arg1); // any
>r10 : any
>foo10(r10arg1) : any
>foo10 : { (a: new (...x: Derived[]) => Derived): new (...x: Derived[]) => Derived; (a: any): any; }
>r10arg1 : new <T extends Derived>(...x: T[]) => T

var r10a = [r10arg1, r10arg2];
>r10a : { new <T extends Derived>(...x: T[]): T; }[]
>[r10arg1, r10arg2] : { new <T extends Derived>(...x: T[]): T; }[]
>r10arg1 : new <T extends Derived>(...x: T[]) => T
>r10arg2 : new (...x: Derived[]) => Derived

var r10b = [r10arg2, r10arg1];
>r10b : { new <T extends Derived>(...x: T[]): T; }[]
>[r10arg2, r10arg1] : { new <T extends Derived>(...x: T[]): T; }[]
>r10arg2 : new (...x: Derived[]) => Derived
>r10arg1 : new <T extends Derived>(...x: T[]) => T

var r11arg1: new <T extends Base>(x: T, y: T) => T;
>r11arg1 : new <T extends Base>(x: T, y: T) => T
>T : T
>Base : Base
>x : T
>T : T
>y : T
>T : T
>T : T

var r11arg2: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>r11arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
>foo : string
>bar : string
>Base : Base

var r11 = foo11(r11arg1); // any
>r11 : any
>foo11(r11arg1) : any
>foo11 : { (a: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base; (a: any): any; }
>r11arg1 : new <T extends Base>(x: T, y: T) => T

var r11a = [r11arg1, r11arg2];
>r11a : { new <T extends Base>(x: T, y: T): T; }[]
>[r11arg1, r11arg2] : { new <T extends Base>(x: T, y: T): T; }[]
>r11arg1 : new <T extends Base>(x: T, y: T) => T
>r11arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base

var r11b = [r11arg2, r11arg1];
>r11b : { new <T extends Base>(x: T, y: T): T; }[]
>[r11arg2, r11arg1] : { new <T extends Base>(x: T, y: T): T; }[]
>r11arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>r11arg1 : new <T extends Base>(x: T, y: T) => T

var r12arg1: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>;
>r12arg1 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
>T : T
>Array : T[]
>Base : Base
>x : Base[]
>Array : T[]
>Base : Base
>y : T
>T : T
>Array : T[]
>Derived : Derived

var r12arg2: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>r12arg2 : new (x: Base[], y: Derived2[]) => Derived[]
>x : Base[]
>Array : T[]
>Base : Base
>y : Derived2[]
>Array : T[]
>Derived2 : Derived2
>Array : T[]
>Derived : Derived

var r12 = foo12(r12arg1); // any
>r12 : new (x: Base[], y: Derived2[]) => Derived[]
>foo12(r12arg1) : new (x: Base[], y: Derived2[]) => Derived[]
>foo12 : { (a: new (x: Base[], y: Derived2[]) => Derived[]): new (x: Base[], y: Derived2[]) => Derived[]; (a: any): any; }
>r12arg1 : new <T extends Base[]>(x: Base[], y: T) => Derived[]

var r12a = [r12arg1, r12arg2];
>r12a : { new <T extends Base[]>(x: Base[], y: T): Derived[]; }[]
>[r12arg1, r12arg2] : { new <T extends Base[]>(x: Base[], y: T): Derived[]; }[]
>r12arg1 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
>r12arg2 : new (x: Base[], y: Derived2[]) => Derived[]

var r12b = [r12arg2, r12arg1];
>r12b : { new (x: Base[], y: Derived2[]): Derived[]; }[]
>[r12arg2, r12arg1] : { new (x: Base[], y: Derived2[]): Derived[]; }[]
>r12arg2 : new (x: Base[], y: Derived2[]) => Derived[]
>r12arg1 : new <T extends Base[]>(x: Base[], y: T) => Derived[]

var r13arg1: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
>r13arg1 : new <T extends Derived[]>(x: Base[], y: T) => T
>T : T
>Array : T[]
>Derived : Derived
>x : Base[]
>Array : T[]
>Base : Base
>y : T
>T : T
>T : T

var r13arg2: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>r13arg2 : new (x: Base[], y: Derived[]) => Derived[]
>x : Base[]
>Array : T[]
>Base : Base
>y : Derived[]
>Array : T[]
>Derived : Derived
>Array : T[]
>Derived : Derived

var r13 = foo13(r13arg1); // any
>r13 : any
>foo13(r13arg1) : any
>foo13 : { (a: new (x: Base[], y: Derived[]) => Derived[]): new (x: Base[], y: Derived[]) => Derived[]; (a: any): any; }
>r13arg1 : new <T extends Derived[]>(x: Base[], y: T) => T

var r13a = [r13arg1, r13arg2];
>r13a : { new <T extends Derived[]>(x: Base[], y: T): T; }[]
>[r13arg1, r13arg2] : { new <T extends Derived[]>(x: Base[], y: T): T; }[]
>r13arg1 : new <T extends Derived[]>(x: Base[], y: T) => T
>r13arg2 : new (x: Base[], y: Derived[]) => Derived[]

var r13b = [r13arg2, r13arg1];
>r13b : { new <T extends Derived[]>(x: Base[], y: T): T; }[]
>[r13arg2, r13arg1] : { new <T extends Derived[]>(x: Base[], y: T): T; }[]
>r13arg2 : new (x: Base[], y: Derived[]) => Derived[]
>r13arg1 : new <T extends Derived[]>(x: Base[], y: T) => T

var r14arg1: new <T>(x: { a: T; b: T }) => T;
>r14arg1 : new <T>(x: { a: T; b: T; }) => T
>T : T
>x : { a: T; b: T; }
>a : T
>T : T
>b : T
>T : T
>T : T

var r14arg2: new (x: { a: string; b: number }) => Object;
>r14arg2 : new (x: { a: string; b: number; }) => Object
>x : { a: string; b: number; }
>a : string
>b : number
>Object : Object

var r14 = foo14(r14arg1); // any
>r14 : any
>foo14(r14arg1) : any
>foo14 : { (a: new (x: { a: string; b: number; }) => Object): new (x: { a: string; b: number; }) => Object; (a: any): any; }
>r14arg1 : new <T>(x: { a: T; b: T; }) => T

var r14a = [r14arg1, r14arg2];
>r14a : { new <T>(x: { a: T; b: T; }): T; }[]
>[r14arg1, r14arg2] : { new <T>(x: { a: T; b: T; }): T; }[]
>r14arg1 : new <T>(x: { a: T; b: T; }) => T
>r14arg2 : new (x: { a: string; b: number; }) => Object

var r14b = [r14arg2, r14arg1];
>r14b : { new <T>(x: { a: T; b: T; }): T; }[]
>[r14arg2, r14arg1] : { new <T>(x: { a: T; b: T; }): T; }[]
>r14arg2 : new (x: { a: string; b: number; }) => Object
>r14arg1 : new <T>(x: { a: T; b: T; }) => T

var r15arg1: new <T>(x: T) => T[];
>r15arg1 : new <T>(x: T) => T[]
>T : T
>x : T
>T : T
>T : T

var r15 = foo15(r15arg1); // any
>r15 : any
>foo15(r15arg1) : any
>foo15 : { (a: { new (x: number): number[]; new (x: string): string[]; }): { new (x: number): number[]; new (x: string): string[]; }; (a: any): any; }
>r15arg1 : new <T>(x: T) => T[]

var r16arg1: new <T extends Base>(x: T) => number[];
>r16arg1 : new <T extends Base>(x: T) => number[]
>T : T
>Base : Base
>x : T
>T : T

var r16 = foo16(r16arg1);
>r16 : { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }
>foo16(r16arg1) : { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }
>foo16 : { (a: { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }): { new <T extends Derived>(x: T): number[]; new <U extends Base>(x: U): number[]; }; (a: any): any; }
>r16arg1 : new <T extends Base>(x: T) => number[]

var r17arg1: new <T>(x: (a: T) => T) => T[];
>r17arg1 : new <T>(x: (a: T) => T) => T[]
>T : T
>x : (a: T) => T
>a : T
>T : T
>T : T
>T : T

var r17 = foo17(r17arg1); // any
>r17 : any
>foo17(r17arg1) : any
>foo17 : { (a: { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }): { new (x: (a: number) => number): number[]; new (x: (a: string) => string): string[]; }; (a: any): any; }
>r17arg1 : new <T>(x: (a: T) => T) => T[]

var r18arg1: new <T>(x: (a: T) => T) => T[];
>r18arg1 : new <T>(x: (a: T) => T) => T[]
>T : T
>x : (a: T) => T
>a : T
>T : T
>T : T
>T : T

var r18 = foo18(r18arg1); 
>r18 : any
>foo18(r18arg1) : any
>foo18 : { (a: { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }): { new (x: { new (a: number): number; new (a: string): string; }): any[]; new (x: { new (a: boolean): boolean; new (a: Date): Date; }): any[]; }; (a: any): any; }
>r18arg1 : new <T>(x: (a: T) => T) => T[]

