Skip to content

v0.0.46

@arthaud arthaud tagged this 24 Mar 05:59
Summary:
This patch adds a special case in the signature selection to infer the return type of lambda functions when used as a parameter of a function call. It infers the lambda parameter type using existing type constraints from other parameters and adds an implicit type annotation on the lambda parameter in order to infer its return type.

The typical use case is `map(lambda x: ..., y)`. Using the type of `y`, we can infer the type of `x` and thus infer the return type of the lambda and the return type of the `map` call.

Reviewed By: mrkmndz

Differential Revision: D20430157

fbshipit-source-id: 407d1bc850869348d1c8c680c546618585bce2b1
Assets 2