File: compoundAdditionAssignmentLHSCanBeAssigned.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 (65 lines) | stat: -rw-r--r-- 2,012 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(32,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'.


==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts (4 errors) ====
    enum E { a, b }
    
    var a: any;
    var b: void;
    
    var x1: any;
    x1 += a;
    x1 += b;
    x1 += true;
    x1 += 0;
    x1 += '';
    x1 += E.a;
    x1 += {};
    x1 += null;
    x1 += undefined;
    
    var x2: string;
    x2 += a;
    x2 += b;
    x2 += true;
    x2 += 0;
    x2 += '';
    x2 += E.a;
    x2 += {};
    x2 += null;
    x2 += undefined;
    
    var x3: number;
    x3 += a;
    x3 += 0;
    x3 += E.a;
    x3 += null;
    ~~~~~~~~~~
!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'.
    x3 += undefined;
    ~~~~~~~~~~~~~~~
!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'.
    
    var x4: E;
    x4 += a;
    x4 += 0;
    x4 += E.a;
    x4 += null;
    ~~~~~~~~~~
!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'.
    x4 += undefined;
    ~~~~~~~~~~~~~~~
!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'.
    
    var x5: boolean;
    x5 += a;
    
    var x6: {};
    x6 += a;
    x6 += '';
    
    var x7: void;
    x7 += a;