File: nativeToBoxedTypes.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (38 lines) | stat: -rw-r--r-- 1,960 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
tests/cases/compiler/nativeToBoxedTypes.ts(3,1): error TS2322: Type 'Number' is not assignable to type 'number'.
  'number' is a primitive, but 'Number' is a wrapper object. Prefer using 'number' when possible.
tests/cases/compiler/nativeToBoxedTypes.ts(7,1): error TS2322: Type 'String' is not assignable to type 'string'.
  'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible.
tests/cases/compiler/nativeToBoxedTypes.ts(11,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
  'boolean' is a primitive, but 'Boolean' is a wrapper object. Prefer using 'boolean' when possible.
tests/cases/compiler/nativeToBoxedTypes.ts(15,1): error TS2322: Type 'Symbol' is not assignable to type 'symbol'.
  'symbol' is a primitive, but 'Symbol' is a wrapper object. Prefer using 'symbol' when possible.


==== tests/cases/compiler/nativeToBoxedTypes.ts (4 errors) ====
    var N = new Number();
    var n = 100;
    n = N;
    ~
!!! error TS2322: Type 'Number' is not assignable to type 'number'.
!!! error TS2322:   'number' is a primitive, but 'Number' is a wrapper object. Prefer using 'number' when possible.
    
    var S = new String();
    var s = "foge";
    s = S;
    ~
!!! error TS2322: Type 'String' is not assignable to type 'string'.
!!! error TS2322:   'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible.
    
    var B = new Boolean();
    var b = true;
    b = B;
    ~
!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
!!! error TS2322:   'boolean' is a primitive, but 'Boolean' is a wrapper object. Prefer using 'boolean' when possible.
    
    var sym: symbol; 
    var Sym: Symbol;
    sym = Sym;
    ~~~
!!! error TS2322: Type 'Symbol' is not assignable to type 'symbol'.
!!! error TS2322:   'symbol' is a primitive, but 'Symbol' is a wrapper object. Prefer using 'symbol' when possible.