Closed
Description
Consider the following code:
T f<T>(T x) => x;
var x = [1].map(f);
The correct type to infer for x
is Iterable<int>
. As of 28cdeb3, the analyzer summary logic infers Iterable<dynamic>
. The reason this happens is that the analyzer summary logic doesn't do downward inference at all; it only does upward inference. So the type of f
in map(f)
is assumed to be (dynamic) -> dynamic
, and therefore the return type of the map
call is inferred to be Iterable<dynamic>
.