|
|
@ -111,6 +111,8 @@ namespace ICSharpCode.Decompiler.Ast.Transforms |
|
|
|
{ |
|
|
|
if (!context.Settings.AnonymousMethods) |
|
|
|
return false; // anonymous method decompilation is disabled
|
|
|
|
if (target != null && !(target is IdentifierExpression || target is ThisReferenceExpression || target is NullReferenceExpression)) |
|
|
|
return false; // don't copy arbitrary expressions, deal with identifiers only
|
|
|
|
|
|
|
|
// Anonymous methods are defined in the same assembly
|
|
|
|
MethodDefinition method = methodRef.ResolveWithinSameModule(); |
|
|
@ -175,7 +177,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
static bool IsPotentialClosure(DecompilerContext context, TypeDefinition potentialDisplayClass) |
|
|
|
internal static bool IsPotentialClosure(DecompilerContext context, TypeDefinition potentialDisplayClass) |
|
|
|
{ |
|
|
|
if (potentialDisplayClass == null || !potentialDisplayClass.IsCompilerGeneratedOrIsInCompilerGeneratedClass()) |
|
|
|
return false; |
|
|
|