diff --git a/tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts b/tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts index d5623a000a2..85421a7697b 100644 --- a/tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts +++ b/tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts @@ -59,6 +59,21 @@ function f4(t: T) { f((a, b, ...x) => {}); } +declare function f5(f: (...args: T) => U): (...args: T) => U; + +let g0 = f5(() => "hello"); +let g1 = f5((x, y) => 42); +let g2 = f5((x: number, y) => 42); +let g3 = f5((x: number, y: number) => x + y); +let g4 = f5((...args) => true); + +declare function pipe(f: (...args: A) => B, g: (x: B) => C): (...args: A) => C; + +let g5 = pipe(() => true, b => 42); +let g6 = pipe(x => "hello", s => s.length); +let g7 = pipe((x, y) => 42, x => "" + x); +let g8 = pipe((x: number, y: string) => 42, x => "" + x); + // Repro from #25288 declare var tuple: [number, string];