Skip to content

Commit efe8989

Browse files
Improve naming of delegate-typed variables.
1 parent 1315f16 commit efe8989

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -631,21 +631,13 @@ public void M()
631631
Action action = delegate {
632632
list.Select((int x) => x * 2);
633633
};
634-
#if OPT && ROSLYN
635-
Action obj = delegate {
636-
#else
637634
Action action2 = delegate {
638-
#endif
639635
list.Select((int x) => x * 2);
640636
};
641637
Console.WriteLine();
642638
action();
643639
Console.WriteLine();
644-
#if OPT && ROSLYN
645-
obj();
646-
#else
647640
action2();
648-
#endif
649641
}
650642
catch (Exception)
651643
{

ICSharpCode.Decompiler/IL/ILTypeExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ public static IType InferType(this ILInstruction inst, ICompilation? compilation
238238
default:
239239
return SpecialType.UnknownType;
240240
}
241+
case ILFunction func when func.DelegateType != null:
242+
return func.DelegateType;
241243
default:
242244
return SpecialType.UnknownType;
243245
}

0 commit comments

Comments
 (0)