Code: List foo(x) { return [1,2,3]; } main() { for (var y in foo(y)) { print(y); } } I would expect some warning when y is used in foo(y)