From 6bdbb1fc84d0c9e9b786141571efb8630742140c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 Jun 2025 20:06:55 +0200 Subject: [PATCH] Improve naming of delegate-typed variables. --- .../TestCases/Pretty/DelegateConstruction.cs | 8 -------- ICSharpCode.Decompiler/IL/ILTypeExtensions.cs | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs index d07f55c79..48d94770c 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs @@ -631,21 +631,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.DelegateConstruction Action action = delegate { list.Select((int x) => x * 2); }; -#if OPT && ROSLYN - Action obj = delegate { -#else Action action2 = delegate { -#endif list.Select((int x) => x * 2); }; Console.WriteLine(); action(); Console.WriteLine(); -#if OPT && ROSLYN - obj(); -#else action2(); -#endif } catch (Exception) { diff --git a/ICSharpCode.Decompiler/IL/ILTypeExtensions.cs b/ICSharpCode.Decompiler/IL/ILTypeExtensions.cs index e67075aa3..fda8cb533 100644 --- a/ICSharpCode.Decompiler/IL/ILTypeExtensions.cs +++ b/ICSharpCode.Decompiler/IL/ILTypeExtensions.cs @@ -238,6 +238,8 @@ namespace ICSharpCode.Decompiler.IL default: return SpecialType.UnknownType; } + case ILFunction func when func.DelegateType != null: + return func.DelegateType; default: return SpecialType.UnknownType; }