40 lines
442 B
Text
40 lines
442 B
Text
|
=== tests/cases/compiler/classImplementsClass3.ts ===
|
||
|
class A { foo(): number { return 1; } }
|
||
|
>A : A
|
||
|
>foo : () => number
|
||
|
|
||
|
class C implements A {
|
||
|
>C : C
|
||
|
>A : A
|
||
|
|
||
|
foo() {
|
||
|
>foo : () => number
|
||
|
|
||
|
return 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
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
|
||
|
|