diff --git a/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs b/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs index ba60db563..af82e224d 100644 --- a/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs +++ b/ICSharpCode.Decompiler/Ast/DeclareVariableInSmallestScope.cs @@ -34,6 +34,8 @@ namespace Decompiler Match m = assignmentPattern.Match(pos); if (m != null && m.Get("ident").Single().Identifier == name) { result = new VariableDeclarationStatement(type, name, m.Get("init").Single().Detach()); + result.Variables.Single().CopyAnnotationsFrom(((ExpressionStatement)pos).Expression); + result.CopyAnnotationsFrom(pos); pos.ReplaceWith(result); } else { result = new VariableDeclarationStatement(type, name);