Browse Source

Fix #1548: Detection of lambdas.

pull/1556/head
Siegfried Pammer 7 years ago
parent
commit
34098b16e8
  1. 4
      ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

4
ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

@ -110,9 +110,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -110,9 +110,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
static bool IsAnonymousMethod(ITypeDefinition decompiledTypeDefinition, IMethod method)
{
if (method == null || !(method.HasGeneratedName() || method.Name.Contains("$") || ContainsAnonymousType(method)))
if (method == null || !(method.HasGeneratedName() || method.Name.Contains("$") || method.IsCompilerGeneratedOrIsInCompilerGeneratedClass() || ContainsAnonymousType(method)))
return false;
if (!(method.IsCompilerGeneratedOrIsInCompilerGeneratedClass() || IsPotentialClosure(decompiledTypeDefinition, method.DeclaringTypeDefinition)))
if (!IsPotentialClosure(decompiledTypeDefinition, method.DeclaringTypeDefinition))
return false;
return true;
}

Loading…
Cancel
Save