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

27 lines
486 B
TypeScript
Raw Normal View History

class A {
foo() { return 1; }
}
abstract class B extends A {
abstract foo();
bar() { super.foo(); }
baz() { return this.foo; }
}
class C extends B {
foo() { return 2; }
qux() { return super.foo() || super.foo; } // 2 errors, foo is abstract
norf() { return super.bar(); }
}
class AA {
foo() { return 1; }
bar() { return this.foo(); }
}
abstract class BB extends AA {
abstract foo();
// inherits bar. But BB is abstract, so this is OK.
}