Skip to content

Commit f20f700

Browse files
committed
Update baselines, except JSX
JSX is still broken
1 parent ecfa902 commit f20f700

11 files changed

+250
-182
lines changed

src/compiler/checker.ts

Lines changed: 74 additions & 87 deletions
Large diffs are not rendered by default.

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,37): error TS2322: Type 'number' is not assignable to type 'boolean'.
1+
tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No suitable overload for this call.
22

33

44
==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ====
55
var map = new Map([["", true], ["", 0]]);
6-
~
7-
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
6+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7+
!!! error TS2755: No suitable overload for this call.
8+
!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable<readonly [string, boolean]>): Map<string, boolean>', gave the following error.
9+
Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable<readonly [string, boolean]>'.
10+
Types of property '[Symbol.iterator]' are incompatible.
11+
Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator<readonly [string, boolean]>'.
12+
Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator<readonly [string, boolean]>'.
13+
Types of property 'next' are incompatible.
14+
Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult<readonly [string, boolean]>'.
15+
Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult<readonly [string, boolean]>'.
16+
Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'.
17+
Type '[string, number]' is not assignable to type 'readonly [string, boolean]'.
18+
Types of property '1' are incompatible.
19+
Type 'number' is not assignable to type 'boolean'.
20+
!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map<string, boolean>', gave the following error.
21+
Type 'number' is not assignable to type 'boolean'.
822
for (var [k, v] of map) {
923
k;
1024
v;
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' is not assignable to type 'boolean'.
1+
tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable overload for this call.
22

33

44
==== tests/cases/compiler/functionOverloads40.ts (1 errors) ====
55
function foo(bar:{a:number;}[]):string;
66
function foo(bar:{a:boolean;}[]):number;
77
function foo(bar:{a:any;}[]):any{ return bar }
88
var x = foo([{a:'bar'}]);
9-
~
10-
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
11-
!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }'
9+
~~~~~~~~~~~~~~~~
10+
!!! error TS2755: No suitable overload for this call.
11+
!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
12+
Type 'string' is not assignable to type 'number'.
13+
!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
14+
Type 'string' is not assignable to type 'boolean'.
1215

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
tests/cases/compiler/functionOverloads41.ts(4,14): error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
1+
tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable overload for this call.
22

33

44
==== tests/cases/compiler/functionOverloads41.ts (1 errors) ====
55
function foo(bar:{a:number;}[]):string;
66
function foo(bar:{a:boolean;}[]):number;
77
function foo(bar:{a:any;}[]):any{ return bar }
88
var x = foo([{}]);
9-
~~
10-
!!! error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
11-
!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:2:19: 'a' is declared here.
9+
~~~~~~~~~
10+
!!! error TS2755: No suitable overload for this call.
11+
!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
12+
Property 'a' is missing in type '{}' but required in type '{ a: number; }'.
13+
!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
14+
Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
1215

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,20): error TS2322: Type 'number' is not assignable to type 'string'.
2-
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,23): error TS2322: Type 'number' is not assignable to type 'string'.
3-
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type 'number' is not assignable to type 'string'.
1+
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No suitable overload for this call.
42

53

6-
==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (3 errors) ====
4+
==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ====
75
class arrTest {
86
test(arg1: number[]);
97
test(arg1: string[]);
@@ -13,11 +11,15 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type
1311
this.test(["hi"]);
1412
this.test([]);
1513
this.test([1, 2, "hi", 5]); // Error
16-
~
17-
!!! error TS2322: Type 'number' is not assignable to type 'string'.
18-
~
19-
!!! error TS2322: Type 'number' is not assignable to type 'string'.
20-
~
21-
!!! error TS2322: Type 'number' is not assignable to type 'string'.
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
!!! error TS2755: No suitable overload for this call.
16+
!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error.
17+
Type 'string' is not assignable to type 'number'.
18+
!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error.
19+
Type 'number' is not assignable to type 'string'.
20+
!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error.
21+
Type 'number' is not assignable to type 'string'.
22+
!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error.
23+
Type 'number' is not assignable to type 'string'.
2224
}
2325
}
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,52): error TS2322: Type 'true' is not assignable to type 'number'.
1+
tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No suitable overload for this call.
22

33

44
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ====
55
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
66
takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
7-
~~~~
8-
!!! error TS2322: Type 'true' is not assignable to type 'number'.
7+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8+
!!! error TS2755: No suitable overload for this call.
9+
!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
10+
Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
11+
Types of property '[Symbol.iterator]' are incompatible.
12+
Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator<readonly [string, number]>'.
13+
Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator<readonly [string, number]>'.
14+
Types of property 'next' are incompatible.
15+
Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult<readonly [string, number]>'.
16+
Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<readonly [string, number]>'.
17+
Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'.
18+
Type '[string, boolean]' is not assignable to type 'readonly [string, number]'.
19+
Types of property '1' are incompatible.
20+
Type 'boolean' is not assignable to type 'number'.
21+
!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
22+
Type 'true' is not assignable to type 'number'.
Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/compiler/overloadResolutionTest1.ts(7,18): error TS2322: Type 'string' is not assignable to type 'boolean'.
2-
tests/cases/compiler/overloadResolutionTest1.ts(18,16): error TS2322: Type 'string' is not assignable to type 'boolean'.
3-
tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true' is not assignable to type 'string'.
1+
tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No suitable overload for this call.
2+
tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No suitable overload for this call.
3+
tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable overload for this call.
44

55

66
==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ====
@@ -11,9 +11,12 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true
1111
var x1 = foo([{a:true}]); // works
1212
var x11 = foo([{a:0}]); // works
1313
var x111 = foo([{a:"s"}]); // error - does not match any signature
14-
~
15-
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
16-
!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }'
14+
~~~~~~~~~~~~~~
15+
!!! error TS2755: No suitable overload for this call.
16+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
17+
Type 'string' is not assignable to type 'number'.
18+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
19+
Type 'string' is not assignable to type 'boolean'.
1720
var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string
1821

1922

@@ -25,15 +28,21 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true
2528
var x2 = foo2({a:0}); // works
2629
var x3 = foo2({a:true}); // works
2730
var x4 = foo2({a:"s"}); // error
28-
~
29-
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
30-
!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }'
31+
~~~~~~~~~~~~~
32+
!!! error TS2755: No suitable overload for this call.
33+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error.
34+
Type 'string' is not assignable to type 'number'.
35+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error.
36+
Type 'string' is not assignable to type 'boolean'.
3137

3238

3339
function foo4(bar:{a:number;}):number;
3440
function foo4(bar:{a:string;}):string;
3541
function foo4(bar:{a:any;}):any{ return bar };
3642
var x = foo4({a:true}); // error
37-
~
38-
!!! error TS2322: Type 'true' is not assignable to type 'string'.
39-
!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }'
43+
~~~~~~~~~~~~~~
44+
!!! error TS2755: No suitable overload for this call.
45+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error.
46+
Type 'true' is not assignable to type 'number'.
47+
!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error.
48+
Type 'true' is not assignable to type 'string'.
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,11): error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
1+
tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No suitable overload for this call.
22
tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'.
3-
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,11): error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
3+
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No suitable overload for this call.
44
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
55

66

@@ -11,16 +11,21 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann
1111
};
1212

1313
func(s => ({})); // Error for no applicable overload (object type is missing a and b)
14-
~~~~
15-
!!! error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
16-
!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature.
14+
~~~~~~~~~~~~~~~
15+
!!! error TS2755: No suitable overload for this call.
16+
!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error.
17+
Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'.
18+
!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
19+
Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
1720
func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error)
1821
~~~~
1922
!!! error TS2304: Cannot find name 'blah'.
2023
func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway
21-
~~~~~~~~~~~~~
22-
!!! error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
23-
!!! related TS2728 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here.
24-
!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature.
24+
~~~~~~~~~~~~~~~~~~~~~~~~
25+
!!! error TS2755: No suitable overload for this call.
26+
!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error.
27+
Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'.
28+
!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
29+
Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
2530
~~~~
2631
!!! error TS2304: Cannot find name 'blah'.

0 commit comments

Comments
 (0)