Browse Source

Fix #2033: Wrong place for variable declaration.

pull/2044/head v6.0-preview4
Siegfried Pammer 5 years ago
parent
commit
9f0ca09e56
  1. 1
      ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

1
ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

@ -599,6 +599,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -599,6 +599,7 @@ namespace ICSharpCode.Decompiler.CSharp
// 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 {

Loading…
Cancel
Save