Skip to content

Commit

Permalink
UsingVar
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed May 21, 2022
1 parent 86bcdcb commit 56847a9
Show file tree
Hide file tree
Showing 3 changed files with 335 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,10 @@ private IteratorFinallyFrame PushFrame(BoundTryStatement statement)
// these nodes have to be tracked by the IDE EnC analyzer
Debug.Assert(
syntax.IsKind(SyntaxKind.TryStatement) ||
syntax.IsKind(SyntaxKind.UsingStatement) ||
syntax.IsKind(SyntaxKind.LocalDeclarationStatement) ||
syntax.IsKind(SyntaxKind.ForEachStatement) ||
syntax.IsKind(SyntaxKind.LockStatement) ||
syntax.IsKind(SyntaxKind.UsingStatement));
syntax.IsKind(SyntaxKind.LockStatement));

if (slotAllocatorOpt?.TryGetPreviousStateMachineState(syntax, out var finalizeState) != true)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,13 @@ protected void AddResumableState(SyntaxNode awaitOrYieldReturnSyntax, out int st
protected void AddStateDebugInfo(SyntaxNode node, int stateNumber)
{
Debug.Assert(
node.IsKind(SyntaxKind.AwaitExpression) ||
node.IsKind(SyntaxKind.YieldReturnStatement) ||
node.IsKind(SyntaxKind.TryStatement) ||
node.IsKind(SyntaxKind.LockStatement) ||
node.IsKind(SyntaxKind.UsingStatement) ||
node.IsKind(SyntaxKind.ForEachStatement) ||
node.IsKind(SyntaxKind.AwaitExpression) ||
node.IsKind(SyntaxKind.YieldReturnStatement));
node.IsKind(SyntaxKind.LocalDeclarationStatement) ||
node.IsKind(SyntaxKind.LockStatement) ||
node.IsKind(SyntaxKind.ForEachStatement));

int syntaxOffset = CurrentMethod.CalculateLocalSyntaxOffset(node.SpanStart, node.SyntaxTree);
_stateDebugInfoBuilder.Add(new StateMachineStateDebugInfo(syntaxOffset, stateNumber));
Expand Down
Loading

0 comments on commit 56847a9

Please sign in to comment.