Skip to content

Commit 83d6abc

Browse files
committed
Update baselines
There are more literal types in error messages because error reporting no longer has the advantage of calls to getBaseLiteralType
1 parent 0168f67 commit 83d6abc

7 files changed

+34
-29
lines changed

tests/baselines/reference/expr.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/compiler/expr.ts(87,5): error TS2365: Operator '==' cannot be applied to types 'number' and 'string'.
2-
tests/cases/compiler/expr.ts(88,5): error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'.
2+
tests/cases/compiler/expr.ts(88,5): error TS2365: Operator '==' cannot be applied to types 'number' and 'false'.
33
tests/cases/compiler/expr.ts(94,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'.
4-
tests/cases/compiler/expr.ts(95,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'.
4+
tests/cases/compiler/expr.ts(95,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'false'.
55
tests/cases/compiler/expr.ts(98,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'E'.
66
tests/cases/compiler/expr.ts(115,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'string'.
77
tests/cases/compiler/expr.ts(116,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'false'.
@@ -161,7 +161,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari
161161
!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'string'.
162162
n==b;
163163
~~~~
164-
!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'.
164+
!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'false'.
165165
n==i;
166166
n==n;
167167
n==e;
@@ -172,7 +172,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari
172172
!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'.
173173
s==b;
174174
~~~~
175-
!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'.
175+
!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'false'.
176176
s==i;
177177
s==s;
178178
s==e;

tests/baselines/reference/for-inStatementsArrayErrors.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(5,14): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
22
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(6,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
3-
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(7,9): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'.
3+
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(7,9): error TS2365: Operator '===' cannot be applied to types 'string' and '1'.
44
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(9,16): error TS2339: Property 'unknownProperty' does not exist on type 'string'.
55
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(13,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'.
66
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(17,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'.
@@ -19,7 +19,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.
1919
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
2020
if (x === 1) {
2121
~~~~~~~
22-
!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'number'.
22+
!!! error TS2365: Operator '===' cannot be applied to types 'string' and '1'.
2323
}
2424
let a3 = x.unknownProperty;
2525
~~~~~~~~~~~~~~~

tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,9): error TS2365: Operator '===' cannot be applied to types '"foo"' and '"baz"'.
2-
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,9): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'.
2+
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,9): error TS2365: Operator '==' cannot be applied to types '"foo"' and 'number'.
33
tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,19): error TS2352: Type 'string' cannot be converted to type 'number'.
44

55

@@ -12,7 +12,7 @@ tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparis
1212
var b = "foo" !== ("bar" as "foo");
1313
var c = "foo" == (<number>"bar");
1414
~~~~~~~~~~~~~~~~~~~~~~~~
15-
!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'.
15+
!!! error TS2365: Operator '==' cannot be applied to types '"foo"' and 'number'.
1616
~~~~~~~~~~~~~
1717
!!! error TS2352: Type 'string' cannot be converted to type 'number'.
1818
var d = "foo" === ("bar" as EnhancedString);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
1+
tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'.
22

33

44
==== tests/cases/compiler/switchAssignmentCompat.ts (1 errors) ====
@@ -7,6 +7,6 @@ tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof
77
switch (0) {
88
case Foo: break; // Error expected
99
~~~
10-
!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
10+
!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'.
1111
}
1212

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
tests/cases/compiler/switchCaseCircularRefeference.ts(5,10): error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type 'string'.
2-
Type '{ a: "C"; e: any; }' is not comparable to type 'string'.
1+
tests/cases/compiler/switchCaseCircularRefeference.ts(5,10): error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type '"A" | "C"'.
2+
Type '{ a: "C"; e: any; }' is not comparable to type '"A" | "C"'.
3+
Type '{ a: "C"; e: any; }' is not comparable to type '"C"'.
34

45

56
==== tests/cases/compiler/switchCaseCircularRefeference.ts (1 errors) ====
@@ -9,8 +10,9 @@ tests/cases/compiler/switchCaseCircularRefeference.ts(5,10): error TS2678: Type
910
switch (x.a) {
1011
case x:
1112
~
12-
!!! error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type 'string'.
13-
!!! error TS2678: Type '{ a: "C"; e: any; }' is not comparable to type 'string'.
13+
!!! error TS2678: Type '{ a: "A"; b: any; } | { a: "C"; e: any; }' is not comparable to type '"A" | "C"'.
14+
!!! error TS2678: Type '{ a: "C"; e: any; }' is not comparable to type '"A" | "C"'.
15+
!!! error TS2678: Type '{ a: "C"; e: any; }' is not comparable to type '"C"'.
1416
break;
1517
}
1618
}

tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
2-
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type 'string' is not comparable to type 'number'.
3-
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'boolean' is not comparable to type 'number'.
1+
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'.
2+
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type '0'.
3+
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(6,10): error TS2678: Type '123' is not comparable to type '0'.
4+
tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type '0'.
45

56

6-
==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ====
7+
==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (4 errors) ====
78
class Foo { }
89

910
switch (0) {
1011
case Foo: break; // Error
1112
~~~
12-
!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'.
13+
!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'.
1314
case "sss": break; // Error
1415
~~~~~
15-
!!! error TS2678: Type 'string' is not comparable to type 'number'.
16+
!!! error TS2678: Type '"sss"' is not comparable to type '0'.
1617
case 123: break; // No Error
18+
~~~
19+
!!! error TS2678: Type '123' is not comparable to type '0'.
1720
case true: break; // Error
1821
~~~~
19-
!!! error TS2678: Type 'boolean' is not comparable to type 'number'.
22+
!!! error TS2678: Type 'true' is not comparable to type '0'.
2023
}
2124

2225
var s: any = 0;
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
tests/cases/conformance/es6/Symbols/symbolType9.ts(3,1): error TS2365: Operator '==' cannot be applied to types 'symbol' and 'boolean'.
2-
tests/cases/conformance/es6/Symbols/symbolType9.ts(5,1): error TS2365: Operator '!=' cannot be applied to types 'number' and 'symbol'.
3-
tests/cases/conformance/es6/Symbols/symbolType9.ts(7,1): error TS2365: Operator '===' cannot be applied to types 'symbol' and 'number'.
4-
tests/cases/conformance/es6/Symbols/symbolType9.ts(9,1): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'symbol'.
1+
tests/cases/conformance/es6/Symbols/symbolType9.ts(3,1): error TS2365: Operator '==' cannot be applied to types 'symbol' and 'true'.
2+
tests/cases/conformance/es6/Symbols/symbolType9.ts(5,1): error TS2365: Operator '!=' cannot be applied to types '0' and 'symbol'.
3+
tests/cases/conformance/es6/Symbols/symbolType9.ts(7,1): error TS2365: Operator '===' cannot be applied to types 'symbol' and '1'.
4+
tests/cases/conformance/es6/Symbols/symbolType9.ts(9,1): error TS2365: Operator '!==' cannot be applied to types 'false' and 'symbol'.
55

66

77
==== tests/cases/conformance/es6/Symbols/symbolType9.ts (4 errors) ====
88
var s = Symbol.for("equal");
99
s == s;
1010
s == true;
1111
~~~~~~~~~
12-
!!! error TS2365: Operator '==' cannot be applied to types 'symbol' and 'boolean'.
12+
!!! error TS2365: Operator '==' cannot be applied to types 'symbol' and 'true'.
1313
s != s;
1414
0 != s;
1515
~~~~~~
16-
!!! error TS2365: Operator '!=' cannot be applied to types 'number' and 'symbol'.
16+
!!! error TS2365: Operator '!=' cannot be applied to types '0' and 'symbol'.
1717
s === s;
1818
s === 1;
1919
~~~~~~~
20-
!!! error TS2365: Operator '===' cannot be applied to types 'symbol' and 'number'.
20+
!!! error TS2365: Operator '===' cannot be applied to types 'symbol' and '1'.
2121
s !== s;
2222
false !== s;
2323
~~~~~~~~~~~
24-
!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'symbol'.
24+
!!! error TS2365: Operator '!==' cannot be applied to types 'false' and 'symbol'.

0 commit comments

Comments
 (0)