Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
infer local function return types #26414
Hah, yeah, we had a bug about this at one point over in DDC (dart-archive/dev_compiler#35).
Inference algorithms get a lot more interesting once local functions are involved :). The C# style inference we were planning (for #25490) is not powerful enough to handle them in general, IIRC. Scala might have something that handles it. There was another interesting paper which I can't find the link to at the moment, that extended colored local inference to handle functions.
That said -- if you mainly want return types and you don't need to have parameter types be inferred, then that should make it a lot easier. We should be albe to infer the same way we infer lambda expressions.