41 lines
468 B
Text
41 lines
468 B
Text
=== tests/cases/compiler/classImplementsClass3.ts ===
|
|
class A { foo(): number { return 1; } }
|
|
>A : A
|
|
>foo : () => number
|
|
>1 : number
|
|
|
|
class C implements A {
|
|
>C : C
|
|
>A : A
|
|
|
|
foo() {
|
|
>foo : () => number
|
|
|
|
return 1;
|
|
>1 : number
|
|
}
|
|
}
|
|
|
|
class C2 extends A {}
|
|
>C2 : C2
|
|
>A : A
|
|
|
|
// no errors
|
|
var c: C;
|
|
>c : C
|
|
>C : C
|
|
|
|
var c2: C2;
|
|
>c2 : C2
|
|
>C2 : C2
|
|
|
|
c = c2;
|
|
>c = c2 : C2
|
|
>c : C
|
|
>c2 : C2
|
|
|
|
c2 = c;
|
|
>c2 = c : C
|
|
>c2 : C2
|
|
>c : C
|
|
|