35 lines
No EOL
1.3 KiB
Text
35 lines
No EOL
1.3 KiB
Text
tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'.
|
|
Types have separate declarations of a private property 'x'.
|
|
tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C'.
|
|
Types have separate declarations of a private property 'x'.
|
|
tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2'.
|
|
Types have separate declarations of a private property 'x'.
|
|
|
|
|
|
==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ====
|
|
class A {
|
|
private x = 1;
|
|
foo(): number { return 1; }
|
|
}
|
|
class C implements A {
|
|
~
|
|
!!! error TS2420: Class 'C' incorrectly implements interface 'A'.
|
|
!!! error TS2420: Types have separate declarations of a private property 'x'.
|
|
private x = 1;
|
|
foo() {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
class C2 extends A {}
|
|
|
|
var c: C;
|
|
var c2: C2;
|
|
c = c2;
|
|
~
|
|
!!! error TS2322: Type 'C2' is not assignable to type 'C'.
|
|
!!! error TS2322: Types have separate declarations of a private property 'x'.
|
|
c2 = c;
|
|
~~
|
|
!!! error TS2322: Type 'C' is not assignable to type 'C2'.
|
|
!!! error TS2322: Types have separate declarations of a private property 'x'. |