Skip to content

Commit 4037d07

Browse files
committed
Accept new baselines
1 parent c231000 commit 4037d07

66 files changed

Lines changed: 306 additions & 242 deletions

File tree

Some content is hidden

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

tests/baselines/reference/argumentExpressionContextualTyping.errors.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(16,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'.
22
Property '0' is missing in type '(string | number | boolean)[]'.
3-
tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(17,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'.
3+
tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(17,5): error TS2345: Argument of type '[string, number, true, ...(string | number | boolean)[]]' is not assignable to parameter of type '[string, number, boolean]'.
4+
Types of property 'length' are incompatible.
5+
Type 'number' is not assignable to type '3'.
46
tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(18,5): error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'.
57
Types of property 'x' are incompatible.
68
Type '(string | number)[]' is not assignable to type '[any, any]'.
@@ -29,7 +31,9 @@ tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextua
2931
!!! error TS2345: Property '0' is missing in type '(string | number | boolean)[]'.
3032
baz(["string", 1, true, ...array]); // Error
3133
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'.
34+
!!! error TS2345: Argument of type '[string, number, true, ...(string | number | boolean)[]]' is not assignable to parameter of type '[string, number, boolean]'.
35+
!!! error TS2345: Types of property 'length' are incompatible.
36+
!!! error TS2345: Type 'number' is not assignable to type '3'.
3337
foo(o); // Error because x has an array type namely (string|number)[]
3438
~
3539
!!! error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'.

tests/baselines/reference/argumentExpressionContextualTyping.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function foo({x: [a, b], y: {c, d, e}}) { }
1111
>e : any
1212

1313
function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { }
14-
>bar : ({ x: [a, b], y: { c, d, e } }: { x: [any, number]; y: { c: any; d: any; e?: { f: number; }; }; }) => void
14+
>bar : ({ x: [a, b], y: { c, d, e } }: { x: [any, number?]; y: { c: any; d: any; e?: { f: number; }; }; }) => void
1515
>x : any
1616
>a : any
1717
>b : number

tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte
77
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
88
Types of property 'length' are incompatible.
99
Type '4' is not assignable to type '3'.
10-
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
11-
Property '0' is missing in type 'number[]'.
10+
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type '[number, number, number, ...number[]]' is not assignable to type '[number, number, number]'.
11+
Types of property 'length' are incompatible.
12+
Type 'number' is not assignable to type '3'.
1213

1314

1415
==== tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts (4 errors) ====
@@ -39,6 +40,7 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte
3940
var spr1 = [1, 2, 3, ...tup];
4041
var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error
4142
~~~~
42-
!!! error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
43-
!!! error TS2322: Property '0' is missing in type 'number[]'.
43+
!!! error TS2322: Type '[number, number, number, ...number[]]' is not assignable to type '[number, number, number]'.
44+
!!! error TS2322: Types of property 'length' are incompatible.
45+
!!! error TS2322: Type 'number' is not assignable to type '3'.
4446

tests/baselines/reference/arrayLiteralExpressionContextualTyping.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var spr1 = [1, 2, 3, ...tup];
6262

6363
var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error
6464
>spr2 : [number, number, number]
65-
>[1, 2, 3, ...tup] : number[]
65+
>[1, 2, 3, ...tup] : [number, number, number, ...number[]]
6666
>1 : 1
6767
>2 : 2
6868
>3 : 3

tests/baselines/reference/arrowFunctionExpressions.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ var p3 = ([, a]) => { };
7171
>a : any
7272

7373
var p4 = ([, ...a]) => { };
74-
>p4 : ([, ...a]: any[]) => void
75-
>([, ...a]) => { } : ([, ...a]: any[]) => void
74+
>p4 : ([, ...a]: [any?, ...any[]]) => void
75+
>([, ...a]) => { } : ([, ...a]: [any?, ...any[]]) => void
7676
> : undefined
7777
>a : any[]
7878

7979
var p5 = ([a = 1]) => { };
80-
>p5 : ([a]: [number]) => void
81-
>([a = 1]) => { } : ([a]: [number]) => void
80+
>p5 : ([a]: [number?]) => void
81+
>([a = 1]) => { } : ([a]: [number?]) => void
8282
>a : number
8383
>1 : 1
8484

tests/baselines/reference/declarationEmitDestructuring3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ function foo(_a) {
1414

1515

1616
//// [declarationEmitDestructuring3.d.ts]
17-
declare function bar([x, z, ...w]: any[]): void;
18-
declare function foo([x, ...y]?: (string | number | boolean)[]): void;
17+
declare function bar([x, z, ...w]: [any, any, ...any[]]): void;
18+
declare function foo([x, ...y]?: [number, string, boolean]): void;

tests/baselines/reference/declarationEmitDestructuring3.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
=== tests/cases/compiler/declarationEmitDestructuring3.ts ===
22
function bar([x, z, ...w]) { }
3-
>bar : ([x, z, ...w]: any[]) => void
3+
>bar : ([x, z, ...w]: [any, any, ...any[]]) => void
44
>x : any
55
>z : any
66
>w : any[]
77

88
function foo([x, ...y] = [1, "string", true]) { }
9-
>foo : ([x, ...y]?: (string | number | boolean)[]) => void
10-
>x : string | number | boolean
11-
>y : (string | number | boolean)[]
12-
>[1, "string", true] : (string | number | boolean)[]
9+
>foo : ([x, ...y]?: [number, string, boolean]) => void
10+
>x : number
11+
>y : (string | boolean)[]
12+
>[1, "string", true] : [number, string, boolean]
1313
>1 : 1
1414
>"string" : "string"
1515
>true : true

tests/baselines/reference/declarationEmitDestructuring5.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function bar2(_a) {
2424

2525

2626
//// [declarationEmitDestructuring5.d.ts]
27-
declare function baz([, z, ,]: [any, any, any]): void;
27+
declare function baz([, z, ,]: [any, any, any?]): void;
2828
declare function foo([, b,]: [any, any]): void;
29-
declare function bar([z, , ,]: [any, any, any]): void;
29+
declare function bar([z, , ,]: [any, any?, any?]): void;
3030
declare function bar1([z, , ,]?: [number, number, number, number, number]): void;
31-
declare function bar2([, , z, , ,]: [any, any, any, any, any]): void;
31+
declare function bar2([, , z, , ,]: [any, any, any, any?, any?]): void;

tests/baselines/reference/declarationEmitDestructuring5.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== tests/cases/compiler/declarationEmitDestructuring5.ts ===
22
function baz([, z, , ]) { }
3-
>baz : ([, z, ,]: [any, any, any]) => void
3+
>baz : ([, z, ,]: [any, any, any?]) => void
44
> : undefined
55
>z : any
66
> : undefined
@@ -11,7 +11,7 @@ function foo([, b, ]: [any, any]): void { }
1111
>b : any
1212

1313
function bar([z, , , ]) { }
14-
>bar : ([z, , ,]: [any, any, any]) => void
14+
>bar : ([z, , ,]: [any, any?, any?]) => void
1515
>z : any
1616
> : undefined
1717
> : undefined
@@ -29,7 +29,7 @@ function bar1([z, , , ] = [1, 3, 4, 6, 7]) { }
2929
>7 : 7
3030

3131
function bar2([,,z, , , ]) { }
32-
>bar2 : ([, , z, , ,]: [any, any, any, any, any]) => void
32+
>bar2 : ([, , z, , ,]: [any, any, any, any?, any?]) => void
3333
> : undefined
3434
> : undefined
3535
>z : any

tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var [a11, b11, c11] = [];
2323
>a11 : any
2424
>b11 : any
2525
>c11 : any
26-
>[] : [undefined, undefined, undefined]
26+
>[] : [undefined?, undefined?, undefined?]
2727

2828
var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]];
2929
>a2 : number

0 commit comments

Comments
 (0)