Skip to content

Commit f63bd4c

Browse files
committed
Add unit test for lamba function
1 parent 79acd3e commit f63bd4c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,15 @@ public static void Issue2920p(in int x = 3)
308308
{
309309
}
310310
#endif
311-
public static void Issue3469([Optional][DefaultParameterValue(0)] int i, [Optional] DateTime d)
311+
public static void Issue3469a([Optional][DefaultParameterValue(0)] int i, [Optional] DateTime d)
312312
{
313313
}
314-
315314
#if CS120
315+
public static Action<int, DateTime> Issue3469b()
316+
{
317+
return ([Optional][DefaultParameterValue(0)] int i, [Optional] DateTime d) => {
318+
};
319+
}
316320
public static D LambdaWithOptionalParameter()
317321
{
318322
return (int x = 10) => x;

ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ public static bool IsDefaultValueAssignmentAllowed(this IParameter parameter)
629629
return false;
630630

631631
if (parameter.Owner == null)
632-
return true;
632+
return true; // Shouldn't happen, but we need to check for it.
633633

634634
for (int i = parameter.Owner.Parameters.Count - 1; i >= 0; i--)
635635
{

0 commit comments

Comments
 (0)