File: classAbstractInstantiations1.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (36 lines) | stat: -rw-r--r-- 1,283 bytes parent folder | download | duplicates (2)
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
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations1.ts(12,1): error TS2511: Cannot create an instance of the abstract class 'A'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations1.ts(13,1): error TS2511: Cannot create an instance of the abstract class 'A'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations1.ts(15,1): error TS2511: Cannot create an instance of the abstract class 'C'.


==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations1.ts (3 errors) ====
    
    //
    // Calling new with (non)abstract classes.
    //
    
    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 A(1); // should report 1 error
    ~~~~~~~~
!!! 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;