diff --git a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs index 9409239ef..6bf75e350 100644 --- a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs @@ -164,6 +164,30 @@ namespace ICSharpCode.Decompiler.CSharp } } + public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration) + { + if (!propertyDeclaration.ExpressionBody.IsNull) + { + VisitAsSequencePoint(propertyDeclaration.ExpressionBody); + } + else + { + base.VisitPropertyDeclaration(propertyDeclaration); + } + } + + public override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration) + { + if (!indexerDeclaration.ExpressionBody.IsNull) + { + VisitAsSequencePoint(indexerDeclaration.ExpressionBody); + } + else + { + base.VisitIndexerDeclaration(indexerDeclaration); + } + } + public override void VisitForStatement(ForStatement forStatement) { // Every element of a for-statement is its own sequence point. diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/NormalizeBlockStatements.cs b/ICSharpCode.Decompiler/CSharp/Transforms/NormalizeBlockStatements.cs index 5df819e21..80d177a12 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/NormalizeBlockStatements.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/NormalizeBlockStatements.cs @@ -218,6 +218,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms return; propertyDeclaration.Modifiers |= propertyDeclaration.Getter.Modifiers; propertyDeclaration.ExpressionBody = m.Get("expression").Single().Detach(); + propertyDeclaration.CopyAnnotationsFrom(propertyDeclaration.Getter); propertyDeclaration.Getter.Remove(); } @@ -230,6 +231,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms return; indexerDeclaration.Modifiers |= indexerDeclaration.Getter.Modifiers; indexerDeclaration.ExpressionBody = m.Get("expression").Single().Detach(); + indexerDeclaration.CopyAnnotationsFrom(indexerDeclaration.Getter); indexerDeclaration.Getter.Remove(); } } diff --git a/ICSharpCode.Decompiler/DebugInfo/DebugInfoGenerator.cs b/ICSharpCode.Decompiler/DebugInfo/DebugInfoGenerator.cs index 828107a0e..8d8eb8557 100644 --- a/ICSharpCode.Decompiler/DebugInfo/DebugInfoGenerator.cs +++ b/ICSharpCode.Decompiler/DebugInfo/DebugInfoGenerator.cs @@ -136,6 +136,30 @@ namespace ICSharpCode.Decompiler.DebugInfo HandleMethod(anonymousMethodExpression); } + public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration) + { + if (!propertyDeclaration.ExpressionBody.IsNull) + { + HandleMethod(propertyDeclaration.ExpressionBody, propertyDeclaration.Annotation()); + } + else + { + base.VisitPropertyDeclaration(propertyDeclaration); + } + } + + public override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration) + { + if (!indexerDeclaration.ExpressionBody.IsNull) + { + HandleMethod(indexerDeclaration.ExpressionBody, indexerDeclaration.Annotation()); + } + else + { + base.VisitIndexerDeclaration(indexerDeclaration); + } + } + public override void VisitQueryFromClause(QueryFromClause queryFromClause) { if (queryFromClause.Parent.FirstChild != queryFromClause)