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

51 lines
2.4 KiB
Text
Raw Normal View History

tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
Property 'x' is private in type 'Bar' but not in type 'I4'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
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-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
~~
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
!!! 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
~~
!!! 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
~~
!!! 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'.