public interface IFoo
{
void Foo(bool flag = true);
}
public class Test : IFoo
{
void IFoo.Foo(bool flag = true) //here compiler generates a warning
{
}
}
The warning says that the given default value will be ignored as it is used in the context which does not allow it.
Why are optional parameters not allowed for explicitly implemented interfaces?