Re: Calling an overloaded generic method by Pavel
Pavel
Fri Aug 29 02:01:55 CDT 2008
On Aug 28, 6:45=A0pm, "Peter Morris" <mrpmorri...@SPAMgmail.com> wrote:
> public void DoSomething<T>(object value)
> {
> =A0 =A0 <code omitted>
>
> }
>
> public void DoSomething<T>()
> {
> =A0 =A0 How do I now call this.DoSomething<T>(null);
>
> }
With the code as written, it should be just "DoSomething<T>(null)" -
there are no ambiguities here. Perhaps you've meant the first
signature to be "DoSomething<T>(T)"? Then you could either use the
cast as suggested, or explicitly specify T on call:
"DoSomething<object>(null)".