132 lines
5.3 KiB
Text
132 lines
5.3 KiB
Text
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers2.ts ===
|
|
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
|
// additional optional properties do not cause errors
|
|
|
|
class S { foo: string; }
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 3, 9))
|
|
|
|
class T { foo: string; }
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 4, 9))
|
|
|
|
var s: S;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0))
|
|
|
|
var t: T;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3))
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24))
|
|
|
|
interface S2 { foo: string; bar?: string }
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 8, 14))
|
|
>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 8, 27))
|
|
|
|
interface T2 { foo: string; baz?: string }
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 9, 14))
|
|
>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 9, 27))
|
|
|
|
var s2: S2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9))
|
|
|
|
var t2: T2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3))
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42))
|
|
|
|
var a: { foo: string; bar?: string }
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 13, 8))
|
|
>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 13, 21))
|
|
|
|
var b: { foo: string; baz?: string }
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 14, 8))
|
|
>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 14, 21))
|
|
|
|
var a2 = { foo: '' };
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 16, 10))
|
|
|
|
var b2 = { foo: '' };
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 17, 10))
|
|
|
|
s = t;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3))
|
|
|
|
t = s;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
|
|
s = s2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
|
|
s = a2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
|
|
s2 = t2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3))
|
|
|
|
t2 = s2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
|
|
s2 = t;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3))
|
|
|
|
s2 = b;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3))
|
|
|
|
s2 = a2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
|
|
a = b;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3))
|
|
|
|
b = a;
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3))
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
|
|
a = s;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3))
|
|
|
|
a = s2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3))
|
|
|
|
a = a2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
|
|
a2 = b2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3))
|
|
|
|
b2 = a2;
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
|
|
a2 = b;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3))
|
|
|
|
a2 = t2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3))
|
|
|
|
a2 = t;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3))
|
|
|