TypeScript/tests/cases/conformance/classes/classDeclarations/mergedInheritedClassInterface.ts
Nathan Shively-Sanders 1651f1809c Improve mergedInheritedClassInterface test case
Covers the case when the merged interface extends an interface, but the
merged class does not extend a class, then trying to extend that class.
2015-10-22 11:32:26 -07:00

46 lines
852 B
TypeScript

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();