TypeScript/tests/baselines/reference/classImplementsClass3.types

42 lines
468 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/classImplementsClass3.ts ===
class A { foo(): number { return 1; } }
>A : A
>foo : () => number
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
class C implements A {
>C : C
>A : A
2014-08-15 23:33:16 +02:00
foo() {
>foo : () => number
2014-08-15 23:33:16 +02:00
return 1;
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
}
}
class C2 extends A {}
>C2 : C2
>A : A
2014-08-15 23:33:16 +02:00
// no errors
var c: C;
>c : C
>C : C
2014-08-15 23:33:16 +02:00
var c2: C2;
>c2 : C2
>C2 : C2
2014-08-15 23:33:16 +02:00
c = c2;
>c = c2 : C2
>c : C
>c2 : C2
2014-08-15 23:33:16 +02:00
c2 = c;
>c2 = c : C
>c2 : C2
>c : C
2014-08-15 23:33:16 +02:00