37 lines
853 B
Text
37 lines
853 B
Text
|
==== 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
|
||
|
~
|
||
|
!!! Type 'C' is not assignable to type 'I':
|
||
|
!!! Property 'other' is missing in type 'C'.
|
||
|
|
||
|
i = d;
|
||
|
d = i; // error
|
||
|
~
|
||
|
!!! Type 'I' is not assignable to type 'D':
|
||
|
!!! Property 'bar' is missing in type 'I'.
|
||
|
|
||
|
c = d;
|
||
|
d = c; // error
|
||
|
~
|
||
|
!!! Type 'C' is not assignable to type 'D':
|
||
|
!!! Property 'other' is missing in type 'C'.
|