268 lines
10 KiB
Text
268 lines
10 KiB
Text
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts ===
|
|
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
|
// no errors expected
|
|
|
|
module SimpleTypes {
|
|
>SimpleTypes : Symbol(SimpleTypes, Decl(assignmentCompatWithObjectMembers.ts, 0, 0))
|
|
|
|
class S { foo: string; }
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 4, 13))
|
|
|
|
class T { foo: string; }
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 5, 13))
|
|
|
|
var s: S;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20))
|
|
|
|
var t: T;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7))
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28))
|
|
|
|
interface S2 { foo: string; }
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 9, 18))
|
|
|
|
interface T2 { foo: string; }
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 10, 18))
|
|
|
|
var s2: S2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13))
|
|
|
|
var t2: T2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7))
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33))
|
|
|
|
var a: { foo: string; }
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 14, 12))
|
|
|
|
var b: { foo: string; }
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 15, 12))
|
|
|
|
var a2 = { foo: '' };
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 17, 14))
|
|
|
|
var b2 = { foo: '' };
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 18, 14))
|
|
|
|
s = t;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7))
|
|
|
|
t = s;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
|
|
s = s2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
|
|
s = a2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
|
|
s2 = t2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7))
|
|
|
|
t2 = s2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
|
|
s2 = t;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7))
|
|
|
|
s2 = b;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7))
|
|
|
|
s2 = a2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
|
|
a = b;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7))
|
|
|
|
b = a;
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7))
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
|
|
a = s;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7))
|
|
|
|
a = s2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7))
|
|
|
|
a = a2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
|
|
a2 = b2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7))
|
|
|
|
b2 = a2;
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
|
|
a2 = b;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7))
|
|
|
|
a2 = t2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7))
|
|
|
|
a2 = t;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7))
|
|
}
|
|
|
|
module ObjectTypes {
|
|
>ObjectTypes : Symbol(ObjectTypes, Decl(assignmentCompatWithObjectMembers.ts, 42, 1))
|
|
|
|
class S { foo: S; }
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 45, 13))
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20))
|
|
|
|
class T { foo: T; }
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 46, 13))
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23))
|
|
|
|
var s: S;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20))
|
|
|
|
var t: T;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7))
|
|
>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23))
|
|
|
|
interface S2 { foo: S2; }
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 50, 18))
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13))
|
|
|
|
interface T2 { foo: T2; }
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 51, 18))
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29))
|
|
|
|
var s2: S2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13))
|
|
|
|
var t2: T2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7))
|
|
>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29))
|
|
|
|
var a: { foo: typeof a; }
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 55, 12))
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
|
|
var b: { foo: typeof b; }
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 56, 12))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
|
|
var a2 = { foo: a2 };
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 58, 14))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
|
|
var b2 = { foo: b2 };
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7))
|
|
>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 59, 14))
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7))
|
|
|
|
s = t;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7))
|
|
|
|
t = s;
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
|
|
s = s2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
|
|
s = a2;
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
|
|
s2 = t2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7))
|
|
|
|
t2 = s2;
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
|
|
s2 = t;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7))
|
|
|
|
s2 = b;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
|
|
s2 = a2;
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
|
|
a = b;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
|
|
b = a;
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
|
|
a = s;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7))
|
|
|
|
a = s2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7))
|
|
|
|
a = a2;
|
|
>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
|
|
a2 = b2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7))
|
|
|
|
b2 = a2;
|
|
>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7))
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
|
|
a2 = b;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7))
|
|
|
|
a2 = t2;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7))
|
|
|
|
a2 = t;
|
|
>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7))
|
|
>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7))
|
|
|
|
}
|