From 11520fd4df21c615207df0d9183deaa94bb3b415 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 26 Feb 2012 21:38:36 +0100 Subject: [PATCH] fix missing calls to WriteDefinition for IndexerDeclaration --- ICSharpCode.Decompiler/Ast/AstBuilder.cs | 1 - ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index a4e2419f6..bf647b379 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -949,7 +949,6 @@ namespace ICSharpCode.Decompiler.Ast IndexerDeclaration ConvertPropertyToIndexer(PropertyDeclaration astProp, PropertyDefinition propDef) { var astIndexer = new IndexerDeclaration(); - astIndexer.Name = astProp.Name; astIndexer.CopyAnnotationsFrom(astProp); astProp.Attributes.MoveTo(astIndexer.Attributes); astIndexer.Modifiers = astProp.Modifiers; diff --git a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs index cfc0e4953..26bd784e2 100644 --- a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs +++ b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs @@ -282,6 +282,9 @@ namespace ICSharpCode.Decompiler.Ast nodeStack.Push(node); startLocations.Push(output.Location); + if (node is AttributedNode && node.GetChildByRole(AstNode.Roles.Identifier).IsNull) + output.WriteDefinition("", node.Annotation(), false); + MemberMapping mapping = node.Annotation(); if (mapping != null) { parentMemberMappings.Push(currentMemberMapping);