Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Overloaded method 'method' differing only by unnamed array types is not CLS-compliant
This error occurs if you have an overloaded method that takes a jagged array and the only difference between the method signatures is the element type of the array. To avoid this error, consider using a rectangular array rather than a jagged array; use an additional parameter to disambiguate the function call; rename one or more of the overloaded methods; or, if CLS Compliance is not needed, remove the CLSCompliantAttribute attribute. For more information on CLS Compliance, see Writing CLS-Compliant Code and Common Language Specification.
Example
The following example generates CS3007:
// CS3007.cs
[assembly: System.CLSCompliant(true)]
public struct S
{
public void F(int[][] array) { }
public void F(byte[][] array) { } // CS3007
// Try this instead:
// public void F1(int[][] array) {}
// public void F2(byte[][] array) {}
// or
// public void F(int[,] array) {}
// public void F(byte[,] array) {}
}