Skip to content

Commit a1e16d2

Browse files
committed
Accept new baselines
1 parent bc7f86c commit a1e16d2

File tree

51 files changed

+2531
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2531
-1035
lines changed
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
2-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
3-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
4-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
5-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
6-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
7-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
8-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
9-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
10-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
11-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'.
1+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2531: Object is possibly 'null'.
2+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2531: Object is possibly 'null'.
3+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2531: Object is possibly 'null'.
4+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(14,14): error TS2531: Object is possibly 'null'.
5+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,14): error TS2531: Object is possibly 'null'.
6+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2531: Object is possibly 'null'.
7+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2531: Object is possibly 'null'.
8+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2531: Object is possibly 'null'.
9+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2531: Object is possibly 'null'.
10+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2531: Object is possibly 'null'.
11+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2531: Object is possibly 'null'.
1212

1313

1414
==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts (11 errors) ====
@@ -23,37 +23,37 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
2323

2424
// null + boolean/Object
2525
var r1 = null + a;
26-
~~~~~~~~
27-
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
26+
~~~~
27+
!!! error TS2531: Object is possibly 'null'.
2828
var r2 = null + b;
29-
~~~~~~~~
30-
!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
29+
~~~~
30+
!!! error TS2531: Object is possibly 'null'.
3131
var r3 = null + c;
32-
~~~~~~~~
33-
!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
32+
~~~~
33+
!!! error TS2531: Object is possibly 'null'.
3434
var r4 = a + null;
35-
~~~~~~~~
36-
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
35+
~~~~
36+
!!! error TS2531: Object is possibly 'null'.
3737
var r5 = b + null;
38-
~~~~~~~~
39-
!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
38+
~~~~
39+
!!! error TS2531: Object is possibly 'null'.
4040
var r6 = null + c;
41-
~~~~~~~~
42-
!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
41+
~~~~
42+
!!! error TS2531: Object is possibly 'null'.
4343

4444
// other cases
4545
var r7 = null + d;
46-
~~~~~~~~
47-
!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
46+
~~~~
47+
!!! error TS2531: Object is possibly 'null'.
4848
var r8 = null + true;
49-
~~~~~~~~~~~
50-
!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
49+
~~~~
50+
!!! error TS2531: Object is possibly 'null'.
5151
var r9 = null + { a: '' };
52-
~~~~~~~~~~~~~~~~
53-
!!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
52+
~~~~
53+
!!! error TS2531: Object is possibly 'null'.
5454
var r10 = null + foo();
55-
~~~~~~~~~~~~
56-
!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
55+
~~~~
56+
!!! error TS2531: Object is possibly 'null'.
5757
var r11 = null + (() => { });
58-
~~~~~~~~~~~~~~~~~~
59-
!!! error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'.
58+
~~~~
59+
!!! error TS2531: Object is possibly 'null'.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(15,10): error TS2531: Object is possibly 'null'.
2+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(16,10): error TS2531: Object is possibly 'null'.
3+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(17,10): error TS2531: Object is possibly 'null'.
4+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(18,10): error TS2531: Object is possibly 'null'.
5+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(19,10): error TS2531: Object is possibly 'null'.
6+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(20,14): error TS2531: Object is possibly 'null'.
7+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(21,14): error TS2531: Object is possibly 'null'.
8+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(22,15): error TS2531: Object is possibly 'null'.
9+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(23,17): error TS2531: Object is possibly 'null'.
10+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts(24,20): error TS2531: Object is possibly 'null'.
11+
12+
13+
==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts (10 errors) ====
14+
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
15+
16+
enum E { a, b, c }
17+
18+
var a: any;
19+
var b: number;
20+
var c: E;
21+
var d: string;
22+
23+
// null + any
24+
var r1: any = null + a;
25+
var r2: any = a + null;
26+
27+
// null + number/enum
28+
var r3 = null + b;
29+
~~~~
30+
!!! error TS2531: Object is possibly 'null'.
31+
var r4 = null + 1;
32+
~~~~
33+
!!! error TS2531: Object is possibly 'null'.
34+
var r5 = null + c;
35+
~~~~
36+
!!! error TS2531: Object is possibly 'null'.
37+
var r6 = null + E.a;
38+
~~~~
39+
!!! error TS2531: Object is possibly 'null'.
40+
var r7 = null + E['a'];
41+
~~~~
42+
!!! error TS2531: Object is possibly 'null'.
43+
var r8 = b + null;
44+
~~~~
45+
!!! error TS2531: Object is possibly 'null'.
46+
var r9 = 1 + null;
47+
~~~~
48+
!!! error TS2531: Object is possibly 'null'.
49+
var r10 = c + null
50+
~~~~
51+
!!! error TS2531: Object is possibly 'null'.
52+
var r11 = E.a + null;
53+
~~~~
54+
!!! error TS2531: Object is possibly 'null'.
55+
var r12 = E['a'] + null;
56+
~~~~
57+
!!! error TS2531: Object is possibly 'null'.
58+
59+
// null + string
60+
var r13 = null + d;
61+
var r14 = null + '';
62+
var r15 = d + null;
63+
var r16 = '' + null;
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
2-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
3-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
4-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
1+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2531: Object is possibly 'null'.
2+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,17): error TS2531: Object is possibly 'null'.
3+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2531: Object is possibly 'null'.
4+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,17): error TS2532: Object is possibly 'undefined'.
5+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2532: Object is possibly 'undefined'.
6+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,22): error TS2531: Object is possibly 'null'.
7+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2532: Object is possibly 'undefined'.
8+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,22): error TS2532: Object is possibly 'undefined'.
59

610

7-
==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (4 errors) ====
11+
==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (8 errors) ====
812
// bug 819721
913
var r1 = null + null;
10-
~~~~~~~~~~~
11-
!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
14+
~~~~
15+
!!! error TS2531: Object is possibly 'null'.
16+
~~~~
17+
!!! error TS2531: Object is possibly 'null'.
1218
var r2 = null + undefined;
13-
~~~~~~~~~~~~~~~~
14-
!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
19+
~~~~
20+
!!! error TS2531: Object is possibly 'null'.
21+
~~~~~~~~~
22+
!!! error TS2532: Object is possibly 'undefined'.
1523
var r3 = undefined + null;
16-
~~~~~~~~~~~~~~~~
17-
!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
24+
~~~~~~~~~
25+
!!! error TS2532: Object is possibly 'undefined'.
26+
~~~~
27+
!!! error TS2531: Object is possibly 'null'.
1828
var r4 = undefined + undefined;
19-
~~~~~~~~~~~~~~~~~~~~~
20-
!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
29+
~~~~~~~~~
30+
!!! error TS2532: Object is possibly 'undefined'.
31+
~~~~~~~~~
32+
!!! error TS2532: Object is possibly 'undefined'.

tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
88
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '+' cannot be applied to types 'Object' and 'T'.
99
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '+' cannot be applied to types 'E' and 'T'.
1010
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '+' cannot be applied to types 'void' and 'T'.
11-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(32,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.
12-
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.
11+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(32,19): error TS2531: Object is possibly 'null'.
12+
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(33,19): error TS2532: Object is possibly 'undefined'.
1313
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.
1414
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'U'.
1515
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'.
@@ -69,11 +69,11 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
6969

7070
// other cases
7171
var r15 = t + null;
72-
~~~~~~~~
73-
!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.
72+
~~~~
73+
!!! error TS2531: Object is possibly 'null'.
7474
var r16 = t + undefined;
75-
~~~~~~~~~~~~~
76-
!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.
75+
~~~~~~~~~
76+
!!! error TS2532: Object is possibly 'undefined'.
7777
var r17 = t + t;
7878
~~~~~
7979
!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'.

0 commit comments

Comments
 (0)