20 lines
No EOL
515 B
Text
20 lines
No EOL
515 B
Text
==== tests/cases/compiler/classImplementsClass2.ts (2 errors) ====
|
|
class A { foo(): number { return 1; } }
|
|
class C implements A {} // error
|
|
~
|
|
!!! Class 'C' incorrectly implements interface 'A':
|
|
!!! Property 'foo' is missing in type 'C'.
|
|
|
|
class C2 extends A {
|
|
foo() {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
var c: C;
|
|
var c2: C2;
|
|
c = c2;
|
|
c2 = c;
|
|
~~
|
|
!!! Type 'C' is not assignable to type 'C2':
|
|
!!! Property 'foo' is missing in type 'C'. |