Browse Source

Fix #1562: Do not transform display class initialization to object initializer.

pull/1596/head
Siegfried Pammer 6 years ago
parent
commit
6d05f36821
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

2
ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

@ -175,7 +175,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -175,7 +175,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
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);
}

Loading…
Cancel
Save