2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2421: Class 'D' incorrectly implements interface 'A':
|
2014-09-18 02:05:45 +02:00
|
|
|
Types have separate declarations of a private property 'x'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2421: Class 'E' incorrectly implements interface 'A':
|
2014-09-18 02:05:45 +02:00
|
|
|
Property 'x' is private in type 'A' but not in type 'E'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'C.x' is inaccessible.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts (3 errors) ====
|
|
|
|
class C {
|
|
|
|
private x: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface A extends C {
|
|
|
|
y: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface A {
|
|
|
|
z: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
class D implements A { // error
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2421: Class 'D' incorrectly implements interface 'A':
|
2014-09-18 02:05:45 +02:00
|
|
|
!!! error TS2421: Types have separate declarations of a private property 'x'.
|
2014-07-13 01:04:16 +02:00
|
|
|
private x: number;
|
|
|
|
y: string;
|
|
|
|
z: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
class E implements A { // error
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2421: Class 'E' incorrectly implements interface 'A':
|
2014-09-18 02:05:45 +02:00
|
|
|
!!! error TS2421: Property 'x' is private in type 'A' but not in type 'E'.
|
2014-07-13 01:04:16 +02:00
|
|
|
x: number;
|
|
|
|
y: string;
|
|
|
|
z: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
var a: A;
|
|
|
|
var r = a.x; // error
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2341: Property 'C.x' is inaccessible.
|