You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the logic for inferring for-each loop variable types.
Currently we only use this logic when the for-each loop declares its
own loop variable, and that loop variable doesn't have an explicit
type. However, for NNBD, we'll need to use the same logic for when
the for-each loop doesn't declare its own loop variable, so that flow
analysis can see whether the implicit assignment to the loop variable
should un-do type promotions or not. Since flow analysis integrates
via the ResolverVisitor, we need the inferred type to be accessible to
the ResolverVisitor. So we create a new method
`StaticTypeAnalyzer.computeForEachElementType` to compute the type,
and call it from `ResolverVisitor`.
Change-Id: I544d72371a6c710297e467b9b37bd909490a7336
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122880
Reviewed-by: Konstantin Shcheglov <[email protected]>
0 commit comments