259 lines
15 KiB
Text
259 lines
15 KiB
Text
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts ===
|
|
// checking assignment compatibility relations for function types. All valid.
|
|
|
|
class Base { foo: string; }
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 12))
|
|
|
|
class Derived extends Base { bar: string; }
|
|
>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 28))
|
|
|
|
class Derived2 extends Derived { baz: string; }
|
|
>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 43))
|
|
>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27))
|
|
>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 32))
|
|
|
|
class OtherDerived extends Base { bing: string; }
|
|
>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 47))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 33))
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49))
|
|
|
|
a: new <T>(x: T) => T[];
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 15))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12))
|
|
|
|
a2: new <T>(x: T) => string[];
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 16))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13))
|
|
|
|
a3: new <T>(x: T) => void;
|
|
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 16))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13))
|
|
|
|
a4: new <T, U>(x: T, y: U) => string;
|
|
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 19))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 24))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15))
|
|
|
|
a5: new <T, U>(x: (arg: T) => U) => T;
|
|
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 19))
|
|
>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 23))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13))
|
|
|
|
a6: new <T extends Base>(x: (arg: T) => Derived) => T;
|
|
>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 42))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 29))
|
|
>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 33))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13))
|
|
>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13))
|
|
|
|
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
|
|
>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 17))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 21))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 31))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 36))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14))
|
|
>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 44))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
|
|
a15: new <T>(x: { a: T; b: T }) => T[];
|
|
>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 63))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 17))
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 21))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 27))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14))
|
|
|
|
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
|
|
>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 30))
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 34))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 40))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14))
|
|
}
|
|
|
|
var x: A;
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49))
|
|
|
|
var b: new <T>(x: T) => T[];
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 15))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12))
|
|
|
|
x.a = b;
|
|
>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3))
|
|
|
|
b = x.a;
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3))
|
|
>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13))
|
|
|
|
var b2: new <T>(x: T) => string[];
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 16))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13))
|
|
|
|
x.a2 = b2;
|
|
>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28))
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3))
|
|
|
|
b2 = x.a2;
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3))
|
|
>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28))
|
|
|
|
var b3: new <T>(x: T) => T;
|
|
>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 16))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13))
|
|
|
|
x.a3 = b3;
|
|
>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34))
|
|
>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3))
|
|
|
|
b3 = x.a3;
|
|
>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3))
|
|
>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34))
|
|
|
|
var b4: new <T, U>(x: T, y: U) => string;
|
|
>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 19))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 24))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15))
|
|
|
|
x.a4 = b4;
|
|
>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30))
|
|
>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3))
|
|
|
|
b4 = x.a4;
|
|
>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3))
|
|
>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30))
|
|
|
|
var b5: new <T, U>(x: (arg: T) => U) => T;
|
|
>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 19))
|
|
>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 23))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13))
|
|
|
|
x.a5 = b5;
|
|
>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41))
|
|
>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3))
|
|
|
|
b5 = x.a5;
|
|
>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3))
|
|
>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41))
|
|
|
|
var b11: new <T, U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
|
>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 20))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 24))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14))
|
|
>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 34))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 39))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16))
|
|
>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 47))
|
|
>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16))
|
|
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0))
|
|
|
|
x.a11 = b11;
|
|
>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58))
|
|
>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3))
|
|
|
|
b11 = x.a11;
|
|
>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3))
|
|
>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58))
|
|
|
|
var b16: new <T>(x: { a: T; b: T }) => T[];
|
|
>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 17))
|
|
>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 21))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14))
|
|
>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 27))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14))
|
|
>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14))
|
|
|
|
x.a16 = b16;
|
|
>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43))
|
|
>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3))
|
|
|
|
b16 = x.a16;
|
|
>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3))
|
|
>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43))
|
|
>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3))
|
|
>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43))
|
|
|