On 3/24/09, Wicky <[email protected]> wrote:
>  Could it be enhanced to have the actual name in ReturnType?

No. It's not a matter of name. What you get is a GenericParameter
instance as it is encoded in the signature.

>  If it's not possible, could you tell me the rule that when to use
>  ReturnType and when to use DeclaringType?

It's a matter of context.

       IEnumerator<ExpressionType> IEnumerable<ExpressionType>.GetEnumerator()
       {
           throw new NotImplementedException();
       }

You're just seeing the closed for of the method:

T IEnumerable<T>.GetEnumerator()

So here the return type is the generic parameter.

In:

       IEnumerator<ExpressionType> HowAboutThis()
       {
           throw new NotImplementedException();
       }

The method is not generic, that's as simple as that.

I suggest you read a bit of IL using ildasm to understand what's going
on under the hood.

-- 
Jb Evain  <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to