Skip to content

Commit

Permalink
WIP: Fix TypeScript type inference for functions passed to map
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Jan 7, 2021
1 parent 76c48d0 commit 88152a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/types/map.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ expectType<fl.ConcurrentFutureInstance<string, string>> (fl.map (String) (reject
// Usage with pipe on Future instances (https://git.io/JLx3F).
expectType<fl.FutureInstance<never, string>> (resolved .pipe (fl.map (String)));
expectType<fl.FutureInstance<string, string>> (rejected .pipe (fl.map (String)));

// Function parameter inference from the second argument in a pipe (https://git.io/JLxsX).
expectType<fl.FutureInstance<never, number>> (resolved .pipe (fl.map (x => x)));
expectType<fl.FutureInstance<string, number>> (rejected .pipe (fl.map (x => x)));

0 comments on commit 88152a2

Please sign in to comment.