-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
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.