TypeScript/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt

232 lines
12 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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; }'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-11-05 21:26:03 +01:00
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'.
2014-07-13 01:04:16 +02:00
==== 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
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
b = a;
b = i;
b = d;
b = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
2014-07-13 01:04:16 +02:00
i = a;
i = b;
i = d;
i = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'I'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
2014-07-13 01:04:16 +02:00
d = a;
d = b;
d = i;
d = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
2014-07-13 01:04:16 +02:00
e = a; // errror
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
e = b; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'.
2014-07-13 01:04:16 +02:00
e = i; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'I' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'.
2014-07-13 01:04:16 +02:00
e = d; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
2014-07-13 01:04:16 +02:00
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
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
a = i; // error
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
a = d;
a = e; // error
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
b = a; // error
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
b = i;
b = d; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'D' is not assignable to type 'Base'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
2014-07-13 01:04:16 +02:00
b = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'Base'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
2014-07-13 01:04:16 +02:00
b = b;
i = a; // error
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
i = b;
i = d; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'D' is not assignable to type 'I'.
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
2014-07-13 01:04:16 +02:00
i = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'I'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
2014-07-13 01:04:16 +02:00
i = i;
d = a;
d = b; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Base' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'.
2014-07-13 01:04:16 +02:00
d = i; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'I' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'.
2014-07-13 01:04:16 +02:00
d = e; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'E' is not assignable to type 'D'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
2014-07-13 01:04:16 +02:00
e = a; // errror
~
2014-11-05 21:26:03 +01:00
!!! 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; }'.
2014-07-13 01:04:16 +02:00
e = b; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Base' is not assignable to type 'E'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
2014-07-13 01:04:16 +02:00
e = i; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'I' is not assignable to type 'E'.
!!! error TS2322: Types have separate declarations of a private property 'foo'.
2014-07-13 01:04:16 +02:00
e = d; // errror
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'D' is not assignable to type 'E'.
!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'.
2014-07-13 01:04:16 +02:00
e = e;
}