Is this not handling parameters?

                if (f.HasGenericParameters)
                {
                    var position = f.GenericParameters.GetIndexByName(
definition.ParameterType.Name <http://definition.parametertype.name/>);
                    if (position != -1)
                        ret = f.GenericParameters[position];
                }

I was gonna go add the typespec stuff now.

On Tue, Nov 30, 2010 at 1:28 PM, Jb Evain <[email protected]> wrote:

> 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




-- 
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer de
votre attention

-- 
--
mono-cecil

Reply via email to