Suppose I have two functions:
Foo(params INotifyPropertyChanged[] items)
{
//do stuff
}
Foo<T>(IEnumerable<T> items) where T : INotifyPropertyChanged
{
Foo(items.ToArray();
}
The second one allows me to call Foo
from a generic class with the constraint where T : INotifyPropertyChanged
, but the second resolves to itself so I get a stack overflow exception.
- Is it possible to specify which overload I want to call when there's some ambiguity?
- Is there another way to call a
params
function from a generic class, assuming the generic type's constraints make it a viable option for theparams
type?
Thanks in advance!