23 lines
No EOL
735 B
Text
23 lines
No EOL
735 B
Text
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod.ts(16,5): error TS2511: Cannot create an instance of the abstract class 'C'.
|
|
|
|
|
|
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethod.ts (1 errors) ====
|
|
abstract class A {
|
|
abstract foo() : number;
|
|
}
|
|
|
|
class B extends A {
|
|
foo() { return 1; }
|
|
}
|
|
|
|
abstract class C extends A {
|
|
abstract foo() : number;
|
|
}
|
|
|
|
var a = new B;
|
|
a.foo();
|
|
|
|
a = new C; // error, cannot instantiate abstract class.
|
|
~~~~~
|
|
!!! error TS2511: Cannot create an instance of the abstract class 'C'.
|
|
a.foo(); |