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; }