39 lines
No EOL
1.3 KiB
Text
39 lines
No EOL
1.3 KiB
Text
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classInstantiatingAbstractClass.ts(8,1): error TS2511: Cannot create an instance of the abstract class 'A'.
|
|
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classInstantiatingAbstractClass.ts(10,1): error TS2511: Cannot create an instance of the abstract class 'C'.
|
|
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classInstantiatingAbstractClass.ts(26,10): error TS2511: Cannot create an instance of the abstract class 'A'.
|
|
|
|
|
|
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classInstantiatingAbstractClass.ts (3 errors) ====
|
|
|
|
abstract class A {}
|
|
|
|
class B extends A {}
|
|
|
|
abstract class C extends B {}
|
|
|
|
new A;
|
|
~~~~~
|
|
!!! error TS2511: Cannot create an instance of the abstract class 'A'.
|
|
new B;
|
|
new C;
|
|
~~~~~
|
|
!!! error TS2511: Cannot create an instance of the abstract class 'C'.
|
|
|
|
var a : A;
|
|
var b : B;
|
|
var c : C;
|
|
|
|
a = new B;
|
|
b = new B;
|
|
c = new B;
|
|
|
|
module M {
|
|
export abstract class A {}
|
|
}
|
|
|
|
import myA = M.A;
|
|
|
|
var aa = new myA;
|
|
~~~~~~~
|
|
!!! error TS2511: Cannot create an instance of the abstract class 'A'.
|
|
|