33 lines
No EOL
1 KiB
Text
33 lines
No EOL
1 KiB
Text
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts(14,26): error TS2513: Abstract member function 'foo' on type 'B' cannot be called via super expression.
|
|
|
|
|
|
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSuperCalls.ts (1 errors) ====
|
|
|
|
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(); } // error, super is abstract
|
|
~~~
|
|
!!! error TS2513: Abstract member function 'foo' on type 'B' cannot be called via super expression.
|
|
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.
|
|
}
|
|
|