File: classExtendingPrimitive.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (44 lines) | stat: -rw-r--r-- 2,957 bytes parent folder | download | duplicates (5)
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
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2693: 'number' only refers to a type, but is being used as a value here.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2693: 'boolean' only refers to a type, but is being used as a value here.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2507: Type 'undefined' is not a constructor function type.
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2552: Cannot find name 'Undefined'. Did you mean 'undefined'?
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2507: Type 'typeof E' is not a constructor function type.


==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (9 errors) ====
    // classes cannot extend primitives
    
    class C extends number { }
                    ~~~~~~
!!! error TS2693: 'number' only refers to a type, but is being used as a value here.
    class C2 extends string { }
                     ~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
    class C3 extends boolean { }
                     ~~~~~~~
!!! error TS2693: 'boolean' only refers to a type, but is being used as a value here.
    class C4 extends Void  { }
                     ~~~~
!!! error TS2304: Cannot find name 'Void'.
    class C4a extends void {}
                      ~~~~
!!! error TS1109: Expression expected.
    class C5 extends Null { }
                     ~~~~
!!! error TS2304: Cannot find name 'Null'.
    class C5a extends null { }
    class C6 extends undefined { }
                     ~~~~~~~~~
!!! error TS2507: Type 'undefined' is not a constructor function type.
    class C7 extends Undefined { }
                     ~~~~~~~~~
!!! error TS2552: Cannot find name 'Undefined'. Did you mean 'undefined'?
    
    enum E { A }
    class C8 extends E { }
                     ~
!!! error TS2507: Type 'typeof E' is not a constructor function type.