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

13 lines
188 B
TypeScript

class Base {
foo() { return 1; }
static create() {
return new this();
}
}
class Derived extends Base {
foo() { return 2; }
}
var d = Derived.create();
d.foo();