TypeScript/tests/baselines/reference/classImplementsClass5.errors.txt
2014-09-11 16:11:08 -07:00

27 lines
772 B
Plaintext

==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ====
class A {
private x = 1;
foo(): number { return 1; }
}
class C implements A {
~
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
!!! error TS2421: Private property 'x' cannot be reimplemented.
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: Private property 'x' cannot be reimplemented.
c2 = c;
~~
!!! error TS2322: Type 'C' is not assignable to type 'C2':
!!! error TS2322: Private property 'x' cannot be reimplemented.