66 lines
3.9 KiB
Text
66 lines
3.9 KiB
Text
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures.ts ===
|
|
module ConstructSignature {
|
|
>ConstructSignature : Symbol(ConstructSignature, Decl(subtypingWithConstructSignatures.ts, 0, 0))
|
|
|
|
declare function foo1(cb: new (x: number) => void): typeof cb;
|
|
>foo1 : Symbol(foo1, Decl(subtypingWithConstructSignatures.ts, 0, 27), Decl(subtypingWithConstructSignatures.ts, 1, 66))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 1, 26))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 1, 35))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 1, 26))
|
|
|
|
declare function foo1(cb: any): any;
|
|
>foo1 : Symbol(foo1, Decl(subtypingWithConstructSignatures.ts, 0, 27), Decl(subtypingWithConstructSignatures.ts, 1, 66))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 2, 26))
|
|
|
|
var rarg1: new (x: number) => number;
|
|
>rarg1 : Symbol(rarg1, Decl(subtypingWithConstructSignatures.ts, 3, 7))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 3, 20))
|
|
|
|
var r = foo1(rarg1); // ok because base returns void
|
|
>r : Symbol(r, Decl(subtypingWithConstructSignatures.ts, 4, 7))
|
|
>foo1 : Symbol(foo1, Decl(subtypingWithConstructSignatures.ts, 0, 27), Decl(subtypingWithConstructSignatures.ts, 1, 66))
|
|
>rarg1 : Symbol(rarg1, Decl(subtypingWithConstructSignatures.ts, 3, 7))
|
|
|
|
var rarg2: new <T>(x: T) => string;
|
|
>rarg2 : Symbol(rarg2, Decl(subtypingWithConstructSignatures.ts, 5, 7))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures.ts, 5, 20))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 5, 23))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures.ts, 5, 20))
|
|
|
|
var r2 = foo1(rarg2); // ok because base returns void
|
|
>r2 : Symbol(r2, Decl(subtypingWithConstructSignatures.ts, 6, 7))
|
|
>foo1 : Symbol(foo1, Decl(subtypingWithConstructSignatures.ts, 0, 27), Decl(subtypingWithConstructSignatures.ts, 1, 66))
|
|
>rarg2 : Symbol(rarg2, Decl(subtypingWithConstructSignatures.ts, 5, 7))
|
|
|
|
declare function foo2(cb: new (x: number, y: number) => void): typeof cb;
|
|
>foo2 : Symbol(foo2, Decl(subtypingWithConstructSignatures.ts, 6, 25), Decl(subtypingWithConstructSignatures.ts, 8, 77))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 8, 26))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 8, 35))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures.ts, 8, 45))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 8, 26))
|
|
|
|
declare function foo2(cb: any): any;
|
|
>foo2 : Symbol(foo2, Decl(subtypingWithConstructSignatures.ts, 6, 25), Decl(subtypingWithConstructSignatures.ts, 8, 77))
|
|
>cb : Symbol(cb, Decl(subtypingWithConstructSignatures.ts, 9, 26))
|
|
|
|
var r3arg1: new (x: number, y: number) => number;
|
|
>r3arg1 : Symbol(r3arg1, Decl(subtypingWithConstructSignatures.ts, 10, 7))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 10, 21))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures.ts, 10, 31))
|
|
|
|
var r3 = foo2(r3arg1); // ok because base returns void
|
|
>r3 : Symbol(r3, Decl(subtypingWithConstructSignatures.ts, 11, 7))
|
|
>foo2 : Symbol(foo2, Decl(subtypingWithConstructSignatures.ts, 6, 25), Decl(subtypingWithConstructSignatures.ts, 8, 77))
|
|
>r3arg1 : Symbol(r3arg1, Decl(subtypingWithConstructSignatures.ts, 10, 7))
|
|
|
|
var r4arg1: new <T>(x: T) => string;
|
|
>r4arg1 : Symbol(r4arg1, Decl(subtypingWithConstructSignatures.ts, 12, 7))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures.ts, 12, 21))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures.ts, 12, 24))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures.ts, 12, 21))
|
|
|
|
var r4 = foo2(r4arg1); // ok because base returns void
|
|
>r4 : Symbol(r4, Decl(subtypingWithConstructSignatures.ts, 13, 7))
|
|
>foo2 : Symbol(foo2, Decl(subtypingWithConstructSignatures.ts, 6, 25), Decl(subtypingWithConstructSignatures.ts, 8, 77))
|
|
>r4arg1 : Symbol(r4arg1, Decl(subtypingWithConstructSignatures.ts, 12, 7))
|
|
}
|