Code inspection: Default value specified for parameter will have no effect because it applies to a member that is used in contexts that do not allow optional arguments
This inspection reports an optional parameter default value that can never be used. The warning appears on members that are called in contexts where optional arguments are not consumed, such as an extension method receiver or certain interface and partial-member scenarios. In those cases, the default value is misleading because callers cannot actually rely on it.
Example
public static class Extensions
{
public static void Print(this string text = "")
{
}
}
public static class Extensions
{
public static void Print(this string text)
{
}
}
Quick-fix
The quick-fix removes the unused default value specification.
21 April 2026