mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
240 lines
16 KiB
Plaintext
240 lines
16 KiB
Plaintext
//// [tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts] ////
|
|
|
|
=== assignmentCompatWithConstructSignaturesWithOptionalParameters.ts ===
|
|
// call signatures in derived types must have the same or fewer optional parameters as the base type
|
|
|
|
interface Base {
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 0, 0))
|
|
|
|
a: new () => number;
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a2: new (x?: number) => number;
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 13))
|
|
|
|
a3: new (x: number) => number;
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 13))
|
|
|
|
a4: new (x: number, y?: number) => number;
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 13))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 23))
|
|
|
|
a5: new (x?: number, y?: number) => number;
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 13))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 24))
|
|
|
|
a6: new (x: number, y: number) => number;
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 8, 13))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 8, 23))
|
|
}
|
|
declare var b: Base;
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 0, 0))
|
|
|
|
declare var a: new () => number;
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
|
|
a = b.a; // ok
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a = b.a2; // ok
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
|
|
a = b.a3; // error
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
|
|
a = b.a4; // error
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
|
|
a = b.a5; // ok
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
|
|
a = b.a6; // error
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 11))
|
|
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
|
|
declare var a2: new (x?: number) => number;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 21))
|
|
|
|
a2 = b.a; // ok
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a2 = b.a2; // ok
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
|
|
a2 = b.a3; // ok
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
|
|
a2 = b.a4; // ok
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
|
|
a2 = b.a5; // ok
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
|
|
a2 = b.a6; // error
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 11))
|
|
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
|
|
declare var a3: new (x: number) => number;
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 21))
|
|
|
|
a3 = b.a; // ok
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a3 = b.a2; // ok
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
|
|
a3 = b.a3; // ok
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
|
|
a3 = b.a4; // ok
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
|
|
a3 = b.a5; // ok
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
|
|
a3 = b.a6; // error
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 11))
|
|
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
|
|
declare var a4: new (x: number, y?: number) => number;
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 21))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 31))
|
|
|
|
a4 = b.a; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a4 = b.a2; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
|
|
a4 = b.a3; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
|
|
a4 = b.a4; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
|
|
a4 = b.a5; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
|
|
a4 = b.a6; // ok
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 11))
|
|
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
|
|
declare var a5: new (x?: number, y?: number) => number;
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 21))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 32))
|
|
|
|
a5 = b.a; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
|
|
|
|
a5 = b.a2; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
|
|
|
|
a5 = b.a3; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
|
|
|
|
a5 = b.a4; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
|
|
|
|
a5 = b.a5; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
|
|
|
|
a5 = b.a6; // ok
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 11))
|
|
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 11))
|
|
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|
|
|