20 lines
No EOL
245 B
TypeScript
20 lines
No EOL
245 B
TypeScript
class Base {
|
|
foo: string;
|
|
}
|
|
|
|
class Derived {
|
|
foo: string;
|
|
bar: number;
|
|
}
|
|
|
|
class Derived2 extends Base {
|
|
bar: string;
|
|
}
|
|
|
|
var b: Base;
|
|
var d1: Derived;
|
|
var d2: Derived2;
|
|
b = d1;
|
|
b = d2;
|
|
|
|
var r: Base[] = [d1, d2]; |