41 lines
1.1 KiB
Text
41 lines
1.1 KiB
Text
|
==== 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
|
||
|
~~
|
||
|
!!! Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar':
|
||
|
!!! Named properties 'x' of types 'Foo' and 'Bar' are not identical.
|
||
|
}
|
||
|
|
||
|
interface I4 extends Foo, Bar { // error
|
||
|
~~
|
||
|
!!! Interface 'I4' incorrectly extends interface 'Bar':
|
||
|
!!! Private property 'x' cannot be reimplemented.
|
||
|
~~
|
||
|
!!! Interface 'I4' incorrectly extends interface 'Foo':
|
||
|
!!! Private property 'x' cannot be reimplemented.
|
||
|
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
|
||
|
~~~
|
||
|
!!! Property 'Foo.x' is inaccessible.
|
||
|
var r3 = i.y; // error
|
||
|
~~~
|
||
|
!!! Property 'Baz.y' is inaccessible.
|