Skip to content

#1401. Async for-in tests for patterns #2032

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

Merged
merged 5 commits into from
May 3, 2023

Conversation

sgrekhov
Copy link
Contributor

@sgrekhov sgrekhov commented May 2, 2023

No description provided.

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives rise to a bit of pondering!

I get the impression (from the patterns feature specification, and from the open and the closed language repo issues) that await for with patterns have never been discussed, and there is no specification (the word await occurs just once in the patterns feature specification, with no connection to for).

So my first take on this is actually that they do not include support for patterns, and any attempt to use a pattern in an await for is a compile-time error.

In particular, there is no section about await for statements corresponding to this section, and similarly nothing corresponding to the pattern-for-in element section.

If this is true then we're done very quickly: Just test that we get some errors for a couple of simple combinations of await for and patterns.

However, the grammar just mentions that the non-terminal forLoopParts is extended to allow patterns, and there is no reference to the applicability of this enhancement with await-for-in constructs. So maybe. ;-)

Checking out the current situation, I get the impression that it has been implemented and lots of things do work already.

So let's test it "as if it were specified to work", and then we can come up with alternate actions to take if it is far from working in some ways.

Looks good! A couple of typos mentioned in comments.

@sgrekhov
Copy link
Contributor Author

sgrekhov commented May 3, 2023

Updated. Please take another look

@sgrekhov sgrekhov requested a review from eernstg May 3, 2023 08:51
Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eernstg eernstg merged commit 7c4a94f into dart-lang:master May 3, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request May 4, 2023
2023-05-04 [email protected] Fixes dart-lang/co19#2034. Fix roll failures, add issues numbers (dart-lang/co19#2035)
2023-05-03 [email protected] dart-lang/co19#1401. Async for-in tests for patterns (dart-lang/co19#2032)
2023-04-28 [email protected] dart-lang/co19#1959. Grammar tests added (dart-lang/co19#2031)
2023-04-28 [email protected] dart-lang/co19#1959. Versioning tests added (dart-lang/co19#2029)

Change-Id: Ic29913ebd7260c4069e6baa27a797219ce12d956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301440
Reviewed-by: Alexander Thomas <[email protected]>
@sgrekhov sgrekhov deleted the co19-1401-await-for-in-1 branch July 18, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants