mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
classImplementsClass2.ts(2,7): error TS2720: Class 'C' incorrectly implements class 'A'. Did you mean to extend 'A' and inherit its members as a subclass?
|
|
Property 'foo' is missing in type 'C' but required in type 'A'.
|
|
classImplementsClass2.ts(13,1): error TS2741: Property 'foo' is missing in type 'C' but required in type 'C2'.
|
|
|
|
|
|
==== classImplementsClass2.ts (2 errors) ====
|
|
class A { foo(): number { return 1; } }
|
|
class C implements A {} // error
|
|
~
|
|
!!! error TS2720: Class 'C' incorrectly implements class 'A'. Did you mean to extend 'A' and inherit its members as a subclass?
|
|
!!! error TS2720: Property 'foo' is missing in type 'C' but required in type 'A'.
|
|
!!! related TS2728 classImplementsClass2.ts:1:11: 'foo' is declared here.
|
|
|
|
class C2 extends A {
|
|
foo() {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
declare var c: C;
|
|
declare var c2: C2;
|
|
c = c2;
|
|
c2 = c;
|
|
~~
|
|
!!! error TS2741: Property 'foo' is missing in type 'C' but required in type 'C2'.
|
|
!!! related TS2728 classImplementsClass2.ts:5:5: 'foo' is declared here. |