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

55 lines
2.3 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2420: Class 'D' incorrectly implements interface 'A'.
Types have separate declarations of a private property 'w'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2415: Class 'E' incorrectly extends base class 'C2'.
Property 'w' is private in type 'C2' but not in type 'E'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2420: Class 'E' incorrectly implements interface 'A'.
Property 'x' is missing in type 'E'.
2014-09-19 15:37:55 +02:00
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'x' is private and only accessible within class 'C'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'w' is private and only accessible within class 'C2'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts (5 errors) ====
class C {
private x: number;
}
class C2 {
private w: number;
}
interface A extends C {
y: string;
}
interface A extends C2 {
z: string;
}
class D extends C implements A { // error
~
!!! error TS2420: Class 'D' incorrectly implements interface 'A'.
!!! error TS2420: Types have separate declarations of a private property 'w'.
2014-07-13 01:04:16 +02:00
private w: number;
y: string;
z: string;
}
class E extends C2 implements A { // error
~
!!! error TS2415: Class 'E' incorrectly extends base class 'C2'.
!!! error TS2415: Property 'w' is private in type 'C2' but not in type 'E'.
2014-07-13 01:04:16 +02:00
~
!!! error TS2420: Class 'E' incorrectly implements interface 'A'.
!!! error TS2420: Property 'x' is missing in type 'E'.
2014-07-13 01:04:16 +02:00
w: number;
y: string;
z: string;
}
var a: A;
var r = a.x; // error
~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
2014-07-13 01:04:16 +02:00
var r2 = a.w; // error
~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'w' is private and only accessible within class 'C2'.