Skip to content
Permalink
Browse files

Fix #1562: Do not transform display class initialization to object in…

…itializer.
  • Loading branch information...
siegfriedpammer committed Jul 7, 2019
1 parent 132595a commit 6d05f36821302071fb086daa098dba3e0f9f428d
Showing with 1 addition and 1 deletion.
  1. +1 −1 ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs
@@ -175,7 +175,7 @@ internal static bool IsSimpleDisplayClass(IType type)

internal static bool IsPotentialClosure(ILTransformContext context, NewObj inst)
{
var decompilationContext = new SimpleTypeResolveContext(context.Function.Method);
var decompilationContext = new SimpleTypeResolveContext(context.Function.Ancestors.OfType<ILFunction>().Last().Method);
return IsPotentialClosure(decompilationContext.CurrentTypeDefinition, inst.Method.DeclaringTypeDefinition);
}

0 comments on commit 6d05f36

Please sign in to comment.
You can’t perform that action at this time.