My class:
public class Foo
{
public override string ToString()
{
return "Bar";
}
public string ToString(params int[] values)
{
return "Buz";
}
public void DoFoo()
{
}
public void DoFoo(params int[] values)
{
}
}
When calling ToString() on expression of type Foo, the compiler chooses the overload with params (passing empty int array). However, when I call DoFoo() it picks the overload without the params, as expected. What is the reason?