70 lines
2.5 KiB
Text
70 lines
2.5 KiB
Text
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures.ts ===
|
|
module ConstructSignature {
|
|
>ConstructSignature : typeof ConstructSignature
|
|
|
|
declare function foo1(cb: new (x: number) => void): typeof cb;
|
|
>foo1 : { (cb: new (x: number) => void): new (x: number) => void; (cb: any): any; }
|
|
>cb : new (x: number) => void
|
|
>x : number
|
|
>cb : new (x: number) => void
|
|
|
|
declare function foo1(cb: any): any;
|
|
>foo1 : { (cb: new (x: number) => void): new (x: number) => void; (cb: any): any; }
|
|
>cb : any
|
|
|
|
var rarg1: new (x: number) => number;
|
|
>rarg1 : new (x: number) => number
|
|
>x : number
|
|
|
|
var r = foo1(rarg1); // ok because base returns void
|
|
>r : new (x: number) => void
|
|
>foo1(rarg1) : new (x: number) => void
|
|
>foo1 : { (cb: new (x: number) => void): new (x: number) => void; (cb: any): any; }
|
|
>rarg1 : new (x: number) => number
|
|
|
|
var rarg2: new <T>(x: T) => string;
|
|
>rarg2 : new <T>(x: T) => string
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
|
|
var r2 = foo1(rarg2); // ok because base returns void
|
|
>r2 : new (x: number) => void
|
|
>foo1(rarg2) : new (x: number) => void
|
|
>foo1 : { (cb: new (x: number) => void): new (x: number) => void; (cb: any): any; }
|
|
>rarg2 : new <T>(x: T) => string
|
|
|
|
declare function foo2(cb: new (x: number, y: number) => void): typeof cb;
|
|
>foo2 : { (cb: new (x: number, y: number) => void): new (x: number, y: number) => void; (cb: any): any; }
|
|
>cb : new (x: number, y: number) => void
|
|
>x : number
|
|
>y : number
|
|
>cb : new (x: number, y: number) => void
|
|
|
|
declare function foo2(cb: any): any;
|
|
>foo2 : { (cb: new (x: number, y: number) => void): new (x: number, y: number) => void; (cb: any): any; }
|
|
>cb : any
|
|
|
|
var r3arg1: new (x: number, y: number) => number;
|
|
>r3arg1 : new (x: number, y: number) => number
|
|
>x : number
|
|
>y : number
|
|
|
|
var r3 = foo2(r3arg1); // ok because base returns void
|
|
>r3 : new (x: number, y: number) => void
|
|
>foo2(r3arg1) : new (x: number, y: number) => void
|
|
>foo2 : { (cb: new (x: number, y: number) => void): new (x: number, y: number) => void; (cb: any): any; }
|
|
>r3arg1 : new (x: number, y: number) => number
|
|
|
|
var r4arg1: new <T>(x: T) => string;
|
|
>r4arg1 : new <T>(x: T) => string
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
|
|
var r4 = foo2(r4arg1); // ok because base returns void
|
|
>r4 : new (x: number, y: number) => void
|
|
>foo2(r4arg1) : new (x: number, y: number) => void
|
|
>foo2 : { (cb: new (x: number, y: number) => void): new (x: number, y: number) => void; (cb: any): any; }
|
|
>r4arg1 : new <T>(x: T) => string
|
|
}
|