Browse Source

fix ConvertPropertyToIndexer code mappings

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
5dab810b3e
  1. 15
      ICSharpCode.Decompiler/Ast/AstBuilder.cs

15
ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -677,9 +677,6 @@ namespace ICSharpCode.Decompiler.Ast @@ -677,9 +677,6 @@ namespace ICSharpCode.Decompiler.Ast
IndexerDeclaration ConvertPropertyToIndexer(PropertyDeclaration astProp, PropertyDefinition propDef)
{
// Create mapping - used in debugger
MemberMapping memberMapping = propDef.CreateCodeMapping(CSharpCodeMapping.SourceCodeMappings);
var astIndexer = new IndexerDeclaration();
astIndexer.Name = astProp.Name;
astIndexer.CopyAnnotationsFrom(astProp);
@ -690,8 +687,18 @@ namespace ICSharpCode.Decompiler.Ast @@ -690,8 +687,18 @@ namespace ICSharpCode.Decompiler.Ast
astIndexer.Getter = astProp.Getter.Detach();
astIndexer.Setter = astProp.Setter.Detach();
astIndexer.Parameters.AddRange(MakeParameters(propDef.Parameters));
if (astIndexer.Getter != null && propDef.GetMethod != null) {
// Create mapping - used in debugger
MemberMapping memberMapping = propDef.GetMethod.CreateCodeMapping(CSharpCodeMapping.SourceCodeMappings);
astIndexer.Getter.WithAnnotation(memberMapping);
}
propDef.WithAnnotation(memberMapping);
if (astIndexer.Setter != null && propDef.SetMethod != null) {
// Create mapping - used in debugger
MemberMapping memberMapping = propDef.SetMethod.CreateCodeMapping(CSharpCodeMapping.SourceCodeMappings);
astIndexer.Setter.WithAnnotation(memberMapping);
}
return astIndexer;
}

Loading…
Cancel
Save