Consider the following code for instance method:
interface I1
{
abstract void M(int x);
}
class Base<T>
{
public void M(T x){}
public void M(int x){}
}
class Derived : Base<int>, I1 // warning CS1956: Member 'Base<int>.M(int)' implements interface member
// 'I1.M(int)' in type 'Derived'. There are multiple matches for the
// interface member at run-time. It is implementation dependent
// which method will be called.
{
}
Observed: CS1956 warning reported for class Derived.
Now try the same scenario with a static method:
interface I1
{
abstract static void M(int x);
}
class Base<T>
{
public static void M(T x){}
public static void M(int x){}
}
class Derived : Base<int>, I1
{
}
Observed: No CS1956 warning
Expected: CS1956 warning reported for class Derived.
Consider the following code for instance method:
Observed: CS1956 warning reported for class Derived.
Now try the same scenario with a static method:
Observed: No CS1956 warning
Expected: CS1956 warning reported for class Derived.