diff --git a/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs b/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs index 0cf993a4b..266540cb9 100644 --- a/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs +++ b/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs @@ -1698,10 +1698,7 @@ namespace ICSharpCode.Decompiler.CSharp var function = ilReader.ReadIL((MethodDefinitionHandle)method.MetadataToken, methodBody, cancellationToken: CancellationToken); function.CheckInvariant(ILPhase.Normal); - if (entityDecl != null) - { - AddAnnotationsToDeclaration(method, entityDecl, function); - } + AddAnnotationsToDeclaration(method, entityDecl, function); var localSettings = settings.Clone(); if (IsWindowsFormsInitializeComponentMethod(method)) @@ -1751,7 +1748,6 @@ namespace ICSharpCode.Decompiler.CSharp entityDecl.AddChild(body, Roles.Body); } - entityDecl.AddAnnotation(function); CleanUpMethodDeclaration(entityDecl, body, function, localSettings.DecompileMemberBodies); }