swc/crates/swc_ecma_parser/tests/tsc/mergedInheritedClassInterface.ts

46 lines
807 B
TypeScript
Raw Normal View History

interface BaseInterface {
required: number;
optional?: number;
}
class BaseClass {
baseMethod() { }
baseNumber: number;
}
interface Child extends BaseInterface {
additional: number;
}
class Child extends BaseClass {
classNumber: number;
method() { }
}
interface ChildNoBaseClass extends BaseInterface {
additional2: string;
}
class ChildNoBaseClass {
classString: string;
method2() { }
}
class Grandchild extends ChildNoBaseClass {
}
// checks if properties actually were merged
var child : Child;
child.required;
child.optional;
child.additional;
child.baseNumber;
child.classNumber;
child.baseMethod();
child.method();
var grandchild: Grandchild;
grandchild.required;
grandchild.optional;
grandchild.additional2;
grandchild.classString;
grandchild.method2();