232 lines
No EOL
12 KiB
Text
232 lines
No EOL
12 KiB
Text
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; }'.
|
|
Property 'foo' is private in type 'I' but not in 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'.
|
|
Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
|
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'.
|
|
Property 'foo' is private in type 'I' but not in type 'D'.
|
|
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'.
|
|
Types have separate declarations of a private property 'foo'.
|
|
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'.
|
|
Property 'foo' is private in type 'I' but not in 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'.
|
|
Types have separate declarations of a private property 'foo'.
|
|
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; }'.
|
|
!!! error TS2322: Property 'foo' is private in type 'I' but not in 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'.
|
|
!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'.
|
|
i = b;
|
|
i = d; // error
|
|
~
|
|
!!! error TS2322: Type 'D' is not assignable to type 'I'.
|
|
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
|
|
i = e; // error
|
|
~
|
|
!!! error TS2322: Type 'E' is not assignable to type 'I'.
|
|
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
|
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'.
|
|
!!! error TS2322: Property 'foo' is private in type 'I' but not in 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'.
|
|
!!! error TS2322: Types have separate declarations of a private property 'foo'.
|
|
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;
|
|
|
|
} |