2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/derivedTypeDoesNotRequireExtendsClause.ts ===
|
|
|
|
class Base {
|
|
|
|
>Base : Base
|
|
|
|
|
|
|
|
foo: string;
|
|
|
|
>foo : string
|
|
|
|
}
|
|
|
|
|
|
|
|
class Derived {
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
foo: string;
|
|
|
|
>foo : string
|
|
|
|
|
|
|
|
bar: number;
|
|
|
|
>bar : number
|
|
|
|
}
|
|
|
|
|
|
|
|
class Derived2 extends Base {
|
|
|
|
>Derived2 : Derived2
|
|
|
|
>Base : Base
|
|
|
|
|
|
|
|
bar: string;
|
|
|
|
>bar : string
|
|
|
|
}
|
|
|
|
|
|
|
|
var b: Base;
|
|
|
|
>b : Base
|
|
|
|
>Base : Base
|
|
|
|
|
|
|
|
var d1: Derived;
|
|
|
|
>d1 : Derived
|
|
|
|
>Derived : Derived
|
|
|
|
|
|
|
|
var d2: Derived2;
|
|
|
|
>d2 : Derived2
|
|
|
|
>Derived2 : Derived2
|
|
|
|
|
|
|
|
b = d1;
|
|
|
|
>b = d1 : Derived
|
|
|
|
>b : Base
|
|
|
|
>d1 : Derived
|
|
|
|
|
|
|
|
b = d2;
|
|
|
|
>b = d2 : Derived2
|
|
|
|
>b : Base
|
|
|
|
>d2 : Derived2
|
|
|
|
|
|
|
|
var r: Base[] = [d1, d2];
|
|
|
|
>r : Base[]
|
|
|
|
>Base : Base
|
2014-10-18 01:53:18 +02:00
|
|
|
>[d1, d2] : (Derived | Derived2)[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>d1 : Derived
|
|
|
|
>d2 : Derived2
|
|
|
|
|