Allow for more type checking in the for-in statement #18552
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
type-enhancement
A request for a change that isn't a bug
If the definition of the for-in statement were re-written to be
T n0 = e.iterator;
while (n0.moveNext()) {
finalConstVarOrType? id = n0.current;
s
}
where 'T' is the static type of 'e.iterator'.
We would be able to detect when the type of 'n0.current' is not assignable to 'id'. See issue #18534 for background.
The text was updated successfully, but these errors were encountered: