2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'foo' is missing in type 'C'.
|
2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2323: Type 'C' is not assignable to type 'C2'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Property 'foo' is missing in type 'C'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/classImplementsClass2.ts (2 errors) ====
|
|
|
|
class A { foo(): number { return 1; } }
|
|
|
|
class C implements A {} // error
|
|
|
|
~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2420: Class 'C' incorrectly implements interface 'A'.
|
|
|
|
!!! error TS2420: Property 'foo' is missing in type 'C'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
class C2 extends A {
|
|
|
|
foo() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var c: C;
|
|
|
|
var c2: C2;
|
|
|
|
c = c2;
|
|
|
|
c2 = c;
|
|
|
|
~~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2323: Type 'C' is not assignable to type 'C2'.
|
|
|
|
!!! error TS2323: Property 'foo' is missing in type 'C'.
|