Browse Source

fix missing calls to WriteDefinition for IndexerDeclaration

pull/320/merge
Siegfried Pammer 14 years ago
parent
commit
11520fd4df
  1. 1
      ICSharpCode.Decompiler/Ast/AstBuilder.cs
  2. 3
      ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

1
ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -949,7 +949,6 @@ namespace ICSharpCode.Decompiler.Ast
IndexerDeclaration ConvertPropertyToIndexer(PropertyDeclaration astProp, PropertyDefinition propDef) IndexerDeclaration ConvertPropertyToIndexer(PropertyDeclaration astProp, PropertyDefinition propDef)
{ {
var astIndexer = new IndexerDeclaration(); var astIndexer = new IndexerDeclaration();
astIndexer.Name = astProp.Name;
astIndexer.CopyAnnotationsFrom(astProp); astIndexer.CopyAnnotationsFrom(astProp);
astProp.Attributes.MoveTo(astIndexer.Attributes); astProp.Attributes.MoveTo(astIndexer.Attributes);
astIndexer.Modifiers = astProp.Modifiers; astIndexer.Modifiers = astProp.Modifiers;

3
ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

@ -282,6 +282,9 @@ namespace ICSharpCode.Decompiler.Ast
nodeStack.Push(node); nodeStack.Push(node);
startLocations.Push(output.Location); startLocations.Push(output.Location);
if (node is AttributedNode && node.GetChildByRole(AstNode.Roles.Identifier).IsNull)
output.WriteDefinition("", node.Annotation<MemberReference>(), false);
MemberMapping mapping = node.Annotation<MemberMapping>(); MemberMapping mapping = node.Annotation<MemberMapping>();
if (mapping != null) { if (mapping != null) {
parentMemberMappings.Push(currentMemberMapping); parentMemberMappings.Push(currentMemberMapping);

Loading…
Cancel
Save