The code below generates a warning CS3006 "Overloaded method MyNamespace.Sample.MyMethod(int[])' differing only in ref or out, or in array rank, is not CLS-compliant".
Is this warning valid, i.e. is this genuinely not CLS-compliant? I'd have thought an explicit interface implementation would not count as an overload.
[assembly: CLSCompliant(true)]
namespace MyNamespace
{
public class Sample : ISample
{
public void MyMethod(int[] array)
{
return;
}
void ISample.MyMethod(ref int[] array)
{
this.MyMethod(array);
}
}
public interface ISample
{
void MyMethod([In] ref int[] array);
}
}