-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failureslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.
Milestone
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>.
Metadata
Metadata
Assignees
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failureslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.