-
Notifications
You must be signed in to change notification settings - Fork 28
#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
Conversation
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 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.
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A02_t04.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A03_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/execution_pattern_await_for_in_statement_A05_t01.dart
Show resolved
Hide resolved
Updated. Please take another look |
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.
LGTM!
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]>
No description provided.