Input code
class OptionalArgumentTest
{
int data;
void Test(string format)
{
TestLocal();
void TestLocal(int a = 0)
{
a.ToString(format);
}
}
}
Erroneous output
using System.Runtime.InteropServices;
internal class OptionalArgumentTest
{
private int data;
private void Test(string format)
{
TestLocal();
void TestLocal([Optional][DefaultParameterValue(0)] int a)
{
a.ToString(format);
}
}
}
Details
Tested at commit 587a359
Regressed in #3470
The loop in TypeSystemExtensions.IsDefaultValueAssignmentAllowed does not account for the extra parameter generated for the closure.
Input code
Erroneous output
Details
Tested at commit 587a359
Regressed in #3470
The loop in
TypeSystemExtensions.IsDefaultValueAssignmentAlloweddoes not account for the extra parameter generated for the closure.