Browse Source

Add test case for C# 12 optional parameters in lambdas.

pull/3243/head
Siegfried Pammer 10 months ago
parent
commit
82256c47fb
  1. 15
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/OptionalArguments.cs

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

@ -24,6 +24,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -24,6 +24,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
internal class OptionalArguments : List<int>
{
public delegate int D(int p = 10);
public enum MyEnum
{
A,
@ -283,5 +285,18 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -283,5 +285,18 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
}
#endif
#if CS120
public static D LambdaWithOptionalParameter()
{
return (int x = 10) => x;
}
public static void Use(D d)
{
d();
d(42);
}
#endif
}
}

Loading…
Cancel
Save