Skip to content

Commit

Permalink
Fix #2033: Wrong place for variable declaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Jun 14, 2020
1 parent 3e40914 commit 9f0ca09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ICSharpCode.Decompiler/CSharp/StatementBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ Statement TransformToForeach(UsingInstruction inst, Expression resource)
// Add the variable annotation for highlighting (TokenTextWriter expects it directly on the ForeachStatement).
foreachStmt.AddAnnotation(new ILVariableResolveResult(foreachVariable, foreachVariable.Type));
foreachStmt.AddAnnotation(new ForeachAnnotation(inst.ResourceExpression, conditionInst, singleGetter));
foreachStmt.CopyAnnotationsFrom(whileLoop);
// If there was an optional return statement, return it as well.
if (optionalReturnAfterLoop != null) {
return new BlockStatement {
Expand Down

0 comments on commit 9f0ca09

Please sign in to comment.