2014-10-28 08:28:59 +01:00
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
2014-09-12 22:35:07 +02:00
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
2014-10-28 08:28:59 +01:00
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
2014-09-18 02:05:45 +02:00
Property 'x' is private in type 'Bar' but not in type 'I4'.
2014-10-28 08:28:59 +01:00
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
2014-09-18 02:05:45 +02:00
Property 'x' is private in type 'Foo' but not in type 'I4'.
2014-09-19 15:37:55 +02:00
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'y' is private and only accessible within class 'Baz'.
2014-09-12 22:35:07 +02:00
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts (5 errors) ====
class Foo {
private x: string;
}
class Bar {
private x: string;
}
interface I3 extends Foo, Bar { // error
~~
2014-10-28 08:28:59 +01:00
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
2014-09-12 00:19:57 +02:00
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
2014-07-13 01:04:16 +02:00
}
interface I4 extends Foo, Bar { // error
~~
2014-10-28 08:28:59 +01:00
!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
!!! error TS2430: Property 'x' is private in type 'Bar' but not in type 'I4'.
2014-07-13 01:04:16 +02:00
~~
2014-10-28 08:28:59 +01:00
!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I4'.
2014-07-13 01:04:16 +02:00
x: string;
}
class Baz {
private y: string;
}
interface I5 extends Foo, Baz {
z: string;
}
var i: I5;
var r: string = i.z;
var r2 = i.x; // error
~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'.
2014-07-13 01:04:16 +02:00
var r3 = i.y; // error
~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'y' is private and only accessible within class 'Baz'.