diff --git a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs index 85fef513e..b17e24656 100644 --- a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs +++ b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs @@ -114,6 +114,9 @@ namespace ICSharpCode.Decompiler.Ast object GetCurrentLocalDefinition() { AstNode node = nodeStack.Peek(); + if (node is Identifier && node.Parent != null) + node = node.Parent; + var parameterDef = node.Annotation(); if (parameterDef != null) return parameterDef; @@ -126,14 +129,11 @@ namespace ICSharpCode.Decompiler.Ast //if (variable.OriginalVariable != null) // return variable.OriginalVariable; return variable; - } else { - } } var label = node as LabelStatement; - if (label != null) - { + if (label != null) { var method = nodeStack.Select(nd => nd.Annotation()).FirstOrDefault(mr => mr != null); if (method != null) return method.ToString() + label.Label;