TypeScript/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
Wesley Wigham 7748694d60
Relate non-augmenting subtypes without resorting to structural comparison (#43624)
* Relate non-augmenting array subtypes without resorting to structural comparison

* Fix lint

* Generalize performance enhancement

* Cache results, feed through via getNormalizedType to remove error intermediates

* Use newly freed up object flags to limit member setting, fix crash with those object flags

* Move flags because there is no TypeFlags.Reference 🤦
2021-04-27 22:52:12 -07:00

220 lines
11 KiB
Plaintext

tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'.
Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I'.
Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'Base'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base'.
Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'.
Property 'foo' is private in type 'Base' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'.
Property 'foo' is private in type 'E' but not in type 'D'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'.
Types have separate declarations of a private property 'foo'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ====
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
module TargetIsPublic {
// targets
class Base {
public foo: string;
}
interface I {
foo: string;
}
var a: { foo: string; }
var b: Base;
var i: I;
// sources
class D {
public foo: string;
}
class E {
private foo: string;
}
var d: D;
var e: E;
a = b;
a = i;
a = d;
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
b = a;
b = i;
b = d;
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
i = a;
i = b;
i = d;
i = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'I'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
d = a;
d = b;
d = i;
d = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
e = a; // errror
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
e = b; // errror
~
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
e = i; // errror
~
!!! error TS2322: Type 'I' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
e = d; // errror
~
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
e = e;
}
module TargetIsPublic {
// targets
class Base {
private foo: string;
}
interface I extends Base {
}
var a: { foo: string; }
var b: Base;
var i: I;
// sources
class D {
public foo: string;
}
class E {
private foo: string;
}
var d: D;
var e: E;
a = b; // error
~
!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
a = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
a = d;
a = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
b = a; // error
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
b = i;
b = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'Base'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
b = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
b = b;
i = a; // error
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'.
i = b;
i = d; // error
~
!!! error TS2322: Type 'D' is not assignable to type 'I'.
i = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'I'.
i = i;
d = a;
d = b; // error
~
!!! error TS2322: Type 'Base' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
d = i; // error
~
!!! error TS2322: Type 'I' is not assignable to type 'D'.
d = e; // error
~
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
e = a; // errror
~
!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
e = b; // errror
~
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
e = i; // errror
~
!!! error TS2322: Type 'I' is not assignable to type 'E'.
e = d; // errror
~
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
e = e;
}