2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ====
|
|
|
|
class A {
|
|
|
|
private x = 1;
|
|
|
|
foo(): number { return 1; }
|
|
|
|
}
|
|
|
|
class C implements A {
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2421: Class 'C' incorrectly implements interface 'A':
|
|
|
|
!!! error TS2421: Private property 'x' cannot be reimplemented.
|
2014-07-13 01:04:16 +02:00
|
|
|
private x = 1;
|
|
|
|
foo() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C2 extends A {}
|
|
|
|
|
|
|
|
var c: C;
|
|
|
|
var c2: C2;
|
|
|
|
c = c2;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2322: Type 'C2' is not assignable to type 'C':
|
|
|
|
!!! error TS2322: Private property 'x' cannot be reimplemented.
|
2014-07-13 01:04:16 +02:00
|
|
|
c2 = c;
|
|
|
|
~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2322: Type 'C' is not assignable to type 'C2':
|
|
|
|
!!! error TS2322: Private property 'x' cannot be reimplemented.
|