-
Notifications
You must be signed in to change notification settings - Fork 7
Error when Reduce is used more than one-time #15
Copy link
Copy link
Open
Description
When a function that uses Reduce type is called more than one-time, flow error occurs:
type MergeAll<T> = Reduce<<X, V>(V) => X => { ...$Exact<X>, ...$Exact<V> }, {}, T>
declare function mergeAll<A>(A): MergeAll<A>
const x = mergeAll([{ a: 1 }, { b: 1 }, { c: 1 }, { a: 2 }])
const xx = mergeAll([{ a: 1 }, { b: 1 }, { c: 1 }, { a: 2 }])
// try to comment this line, the error disappears
;(x: { a: 2, b: 1, c: 1 }) // rightly
// or try to comment this line, the error disappears too
;(xx: { a: 2, b: 1, c: 1 }) // error?!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels