I think it's referring to the generic U
in map
's definition: https://github.com/facebook/flow/blob/master/lib/core.js#L247.
Changing the call to things.map<Thing>(a =>a)
or specifying a return type of Array<Thing>
for myFunction
seems to fix it. It does seem weird that it only shows the error when the export
is present though.
got this too recently, not sure what that means
me too
Flow requires annotations on types in input positions reachable through exports. Until now, we were missing a lot of these cases. This is an example of a case we started catching recently. Even more recent changes, which will be shipped in v0.81.0, will hopefully make these errors clearer. I am also currently working on documentation for fixing these new errors when they appear.
just got this exception. for anyone else, explained here in more detail: https://medium.com/flow-type/asking-for-required-annotations-64d4f9c1edf8
Most helpful comment
I think it's referring to the generic
U
inmap
's definition: https://github.com/facebook/flow/blob/master/lib/core.js#L247.Changing the call to
things.map<Thing>(a =>a)
or specifying a return type ofArray<Thing>
formyFunction
seems to fix it. It does seem weird that it only shows the error when theexport
is present though.