Browse Source

Improve naming of delegate-typed variables.

pull/3500/head
Siegfried Pammer 4 weeks ago
parent
commit
8834c02eb7
  1. 8
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
  2. 2
      ICSharpCode.Decompiler/IL/ILTypeExtensions.cs

8
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs

@ -631,21 +631,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.DelegateConstruction
Action action = delegate { Action action = delegate {
list.Select((int x) => x * 2); list.Select((int x) => x * 2);
}; };
#if OPT && ROSLYN
Action obj = delegate {
#else
Action action2 = delegate { Action action2 = delegate {
#endif
list.Select((int x) => x * 2); list.Select((int x) => x * 2);
}; };
Console.WriteLine(); Console.WriteLine();
action(); action();
Console.WriteLine(); Console.WriteLine();
#if OPT && ROSLYN
obj();
#else
action2(); action2();
#endif
} }
catch (Exception) catch (Exception)
{ {

2
ICSharpCode.Decompiler/IL/ILTypeExtensions.cs

@ -238,6 +238,8 @@ namespace ICSharpCode.Decompiler.IL
default: default:
return SpecialType.UnknownType; return SpecialType.UnknownType;
} }
case ILFunction func when func.DelegateType != null:
return func.DelegateType;
default: default:
return SpecialType.UnknownType; return SpecialType.UnknownType;
} }

Loading…
Cancel
Save