New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift: dataflow for for-in loops
#13909
base: main
Are you sure you want to change the base?
Conversation
|
This is built on top of #13838 - only the last two commits are new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pleasingly straightforward!
I'd like to see iteration through CollectionElement supported + tested in addition to ArrayContent.
| for entry in arr7 | ||
| { | ||
| sink(arg: entry) // $ flow=696 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt it will affect flow, but it might also be nice to have one test in the alternative form:
arr7.forEach { entry in
sink(arg: entry) // $ flow=
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, but doesn't work - I think that's syntactically a call to the method forEach that takes a closure as an argument.
|
Actually after starting on dictionaries I'm no longer sure this is the right way to do this - I think there's an implicit call that generates an iterator or something, and this PR won't capture the behavior of dictionaries properly. |
|
After rethinking how dictionary flow is implemented I think this will work properly for dictionaries. There's still some weirder options (self-iterators and such) that won't be handled. |
e942019
to
1e0f410
Compare
No description provided.