Skip to content

Commit 46f2e57

Browse files
committed
Add an additional test case for mixed length tuples in the target's rest
1 parent 6c5383d commit 46f2e57

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tests/baselines/reference/restTupleUnionWithRestContextualParams.symbols

+8
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ const f1: (...args: [number, string, ...boolean[]] | [string, number, ...boolean
66
>b : Symbol(b, Decl(restTupleUnionWithRestContextualParams.ts, 0, 98))
77
>c : Symbol(c, Decl(restTupleUnionWithRestContextualParams.ts, 0, 101))
88

9+
const f2: (x: string, ...args: [string] | [number, boolean]) => void = (a, b, c) => {};
10+
>f2 : Symbol(f2, Decl(restTupleUnionWithRestContextualParams.ts, 2, 5))
11+
>x : Symbol(x, Decl(restTupleUnionWithRestContextualParams.ts, 2, 11))
12+
>args : Symbol(args, Decl(restTupleUnionWithRestContextualParams.ts, 2, 21))
13+
>a : Symbol(a, Decl(restTupleUnionWithRestContextualParams.ts, 2, 72))
14+
>b : Symbol(b, Decl(restTupleUnionWithRestContextualParams.ts, 2, 74))
15+
>c : Symbol(c, Decl(restTupleUnionWithRestContextualParams.ts, 2, 77))
16+

tests/baselines/reference/restTupleUnionWithRestContextualParams.types

+9
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ const f1: (...args: [number, string, ...boolean[]] | [string, number, ...boolean
77
>b : string | number
88
>c : boolean
99

10+
const f2: (x: string, ...args: [string] | [number, boolean]) => void = (a, b, c) => {};
11+
>f2 : (x: string, ...args: [string] | [number, boolean]) => void
12+
>x : string
13+
>args : [string] | [number, boolean]
14+
>(a, b, c) => {} : (a: string, b: string | number, c: boolean | undefined) => void
15+
>a : string
16+
>b : string | number
17+
>c : boolean | undefined
18+

tests/cases/compiler/restTupleUnionWithRestContextualParams.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
// @noEmit: true
33

44
const f1: (...args: [number, string, ...boolean[]] | [string, number, ...boolean[]]) => void = (a, b, c) => {};
5+
6+
const f2: (x: string, ...args: [string] | [number, boolean]) => void = (a, b, c) => {};

0 commit comments

Comments
 (0)