提交 6561afe7 编写于 作者: A AlekseyTs 提交者: GitHub

Merge pull request #13935 from AlekseyTs/Issue13830

Remove code that doesn’t have any observable side-effects.
......@@ -1640,10 +1640,6 @@ public override BoundNode VisitUsingStatement(BoundUsingStatement node)
{
switch (local.DeclarationKind)
{
case LocalDeclarationKind.RegularVariable:
ReportIfUnused(local, assigned: true);
break;
case LocalDeclarationKind.UsingVariable:
NoteRead(local); // At the end of the statement, there's an implied read when the local is disposed
break;
......@@ -1672,17 +1668,7 @@ public override BoundNode VisitFixedStatement(BoundFixedStatement node)
}
}
var result = base.VisitFixedStatement(node);
foreach (LocalSymbol local in node.Locals)
{
if (local.DeclarationKind == LocalDeclarationKind.RegularVariable)
{
ReportIfUnused(local, assigned: true);
}
}
return result;
return base.VisitFixedStatement(node);
}
public override BoundNode VisitSequence(BoundSequence node)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册