TypeScript/tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts
2017-02-24 17:48:06 -08:00

12 lines
No EOL
291 B
TypeScript

type StringTree = string | StringTreeCollection;
class StringTreeCollectionBase {
[n: number]: StringTree;
}
class StringTreeCollection extends StringTreeCollectionBase { }
var x: StringTree;
if (typeof x !== "string") {
x[0] = "";
x[0] = new StringTreeCollection;
}