1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
=== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations1.ts ===
//
// Calling new with (non)abstract classes.
//
abstract class A {}
>A : A
class B extends A {}
>B : B
>A : A
abstract class C extends B {}
>C : C
>B : B
new A;
>new A : any
>A : typeof A
new A(1); // should report 1 error
>new A(1) : any
>A : typeof A
>1 : 1
new B;
>new B : B
>B : typeof B
new C;
>new C : any
>C : typeof C
var a : A;
>a : A
var b : B;
>b : B
var c : C;
>c : C
a = new B;
>a = new B : B
>a : A
>new B : B
>B : typeof B
b = new B;
>b = new B : B
>b : B
>new B : B
>B : typeof B
c = new B;
>c = new B : B
>c : C
>new B : B
>B : typeof B
|