diff --git a/ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs b/ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs index 14048219e..aa4148c33 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs @@ -110,9 +110,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms static bool IsAnonymousMethod(ITypeDefinition decompiledTypeDefinition, IMethod method) { - if (method == null || !(method.HasGeneratedName() || method.Name.Contains("$") || method.IsCompilerGeneratedOrIsInCompilerGeneratedClass() || ContainsAnonymousType(method))) + if (method == null) return false; - if (!IsPotentialClosure(decompiledTypeDefinition, method.DeclaringTypeDefinition)) + if (!(method.HasGeneratedName() + || method.Name.Contains("$") + || method.IsCompilerGeneratedOrIsInCompilerGeneratedClass() + || IsPotentialClosure(decompiledTypeDefinition, method.DeclaringTypeDefinition) + || ContainsAnonymousType(method))) return false; return true; }