From 66850e472503e705d2fac6072f64a62b93f91b8b Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 10 Jan 2021 23:13:08 +0100 Subject: [PATCH] Fix #2270: I love deleting code that causes problems and no longer makes any sense at all! --- .../IL/Transforms/LocalFunctionDecompiler.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs b/ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs index 94cb2279f..d1ca322e1 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/LocalFunctionDecompiler.cs @@ -330,13 +330,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms return null; foreach (var v in context.Function.Descendants.OfType().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))) continue; return v;