-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Async-streams: Disposal in async-iterator methods #31527
Changes from all commits
74da5ac
766c1ca
6ae63d4
9fc88c2
b51a281
7ab6396
d17fca1
30484e7
cc715c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1651,6 +1651,11 @@ protected virtual void VisitFinallyBlock(BoundStatement finallyBlock, ref TLocal | |
VisitStatement(finallyBlock); // this should generate no pending branches | ||
} | ||
|
||
public override BoundNode VisitExtractedFinallyBlock(BoundExtractedFinallyBlock node) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Doesn't this node only existing in lowering? If so, this visit method should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Async rewriting uses data flow analysis (in In reply to: 240715273 [](ancestors = 240715273) |
||
{ | ||
return VisitBlock(node.FinallyBlock); | ||
} | ||
|
||
public sealed override BoundNode VisitReturnStatement(BoundReturnStatement node) | ||
{ | ||
var result = VisitReturnStatementNoAdjust(node); | ||
|
@@ -2286,7 +2291,7 @@ public override BoundNode VisitForEachStatement(BoundForEachStatement node) | |
LoopTail(node); | ||
ResolveBreaks(breakState, node.BreakLabel); | ||
|
||
if (((CommonForEachStatementSyntax)node.Syntax).AwaitKeyword != default) | ||
if (AwaitUsingAndForeachAddsPendingBranch && ((CommonForEachStatementSyntax)node.Syntax).AwaitKeyword != default) | ||
{ | ||
PendingBranches.Add(new PendingBranch(node, this.State)); | ||
} | ||
|
@@ -2623,14 +2628,14 @@ public override BoundNode VisitUsingStatement(BoundUsingStatement node) | |
|
||
VisitStatement(node.Body); | ||
|
||
if (AwaitUsingAddsPendingBranch && node.AwaitOpt != null) | ||
if (AwaitUsingAndForeachAddsPendingBranch && node.AwaitOpt != null) | ||
{ | ||
PendingBranches.Add(new PendingBranch(node, this.State)); | ||
} | ||
return null; | ||
} | ||
|
||
public abstract bool AwaitUsingAddsPendingBranch { get; } | ||
public abstract bool AwaitUsingAndForeachAddsPendingBranch { get; } | ||
|
||
public override BoundNode VisitFixedStatement(BoundFixedStatement node) | ||
{ | ||
|
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.
Minor point: perhaps just "... a
yield return
oryield break
..." #WontFixThere 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.
Those two lines were copied from the existing C# spec. I'll keep as-is.
In reply to: 240409214 [](ancestors = 240409214)