From 2e6a4988d395fc9859baad987e5aeea9d1a203da Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 3 Aug 2019 18:09:09 +0200 Subject: [PATCH] Fix #1594: Use Equals to compare generic IMethods. --- ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs index 814e4b35f..fefd35111 100644 --- a/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs @@ -212,7 +212,7 @@ namespace ICSharpCode.Decompiler.CSharp Debug.Assert(method.IsLocalFunction); method = method.ReducedFrom; foreach (var parent in currentFunction.Ancestors.OfType()) { - var definition = parent.LocalFunctions.FirstOrDefault(f => f.Method == method); + var definition = parent.LocalFunctions.FirstOrDefault(f => f.Method.Equals(method)); if (definition != null) { return definition; }