Browse Source

Fix #2270: I love deleting code that causes problems and no longer makes any sense at all!

pull/2276/head v7.0-preview2
Siegfried Pammer 5 years ago
parent
commit
66850e4725
  1. 7
      ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs

7
ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs

@ -330,13 +330,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return null; return null;
foreach (var v in context.Function.Descendants.OfType<ILFunction>().SelectMany(f => f.Variables)) foreach (var v in context.Function.Descendants.OfType<ILFunction>().SelectMany(f => f.Variables))
{ {
if (v.Kind != VariableKind.Local && v.Kind != VariableKind.DisplayClassLocal && v.Kind != VariableKind.StackSlot)
{
if (!(v.Kind == VariableKind.Parameter && v.Index == -1))
continue;
if (v.Type.Equals(field.Type))
return v;
}
if (!(TransformDisplayClassUsage.IsClosure(context, v, out var varType, out _) && varType.Equals(field.Type))) if (!(TransformDisplayClassUsage.IsClosure(context, v, out var varType, out _) && varType.Equals(field.Type)))
continue; continue;
return v; return v;

Loading…
Cancel
Save