1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2741: Property 'other' is missing in type 'C' but required in type 'I'.
tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2741: Property 'bar' is missing in type 'I' but required in type 'D'.
tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2739: Type 'C' is missing the following properties from type 'D': other, bar
==== tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts (3 errors) ====
class C {
public foo(x: any) { return x; }
private x = 1;
}
interface I extends C {
other(x: any): any;
}
class D extends C implements I {
public foo(x: any) { return x; }
other(x: any) { return x; }
bar() { }
}
var c: C;
var i: I;
var d: D;
c = i;
i = c; // error
~
!!! error TS2741: Property 'other' is missing in type 'C' but required in type 'I'.
!!! related TS2728 tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts:7:5: 'other' is declared here.
i = d;
d = i; // error
~
!!! error TS2741: Property 'bar' is missing in type 'I' but required in type 'D'.
!!! related TS2728 tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts:13:5: 'bar' is declared here.
c = d;
d = c; // error
~
!!! error TS2739: Type 'C' is missing the following properties from type 'D': other, bar
|