Skip to content

Commit 4f4d9f6

Browse files
committed
Add test
1 parent 475b103 commit 4f4d9f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/cases/compiler/genericFunctionInference1.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,8 @@ declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
193193
foo2(() => {});
194194
foo2(identity);
195195
foo2(identity, 1);
196+
197+
// Repro from #30324
198+
199+
declare function times<T>(fn: (i: number) => T): (n: number) => T[];
200+
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]

0 commit comments

Comments
 (0)