On Tue, Nov 30, 2010 at 7:23 PM, Greg Young <[email protected]> wrote:
> something like this? one of the extensions I mentioned I can give away btw.
>         public static TypeReference GetTypeWithGenericResolve(this
> ParameterDefinition definition)
>         {
>             TypeReference ret = definition.ParameterType;
>             if (definition.ParameterType.IsGenericParameter)
>             {

Then you can write:

var genericParameter = (GenericParameter)definition.ParameterType;

int position = genericParameter.Position;

And work from here to get the mapped argument.

Also this code doesn't deal with the scenarios I wrote about earlier,
for instance, generic parameters defined on methods, or typespecs
based on generic parameters.

-- 
--
mono-cecil

Reply via email to