Hi!,

I'm answering inline:

On Thu, Jul 30, 2015 at 8:40 PM, Greg Rosenbaum <[email protected]> wrote:
> What does the MetadataType enum indicate exactly, and what do some of its
> values mean? Most of them are pretty obvious, but a few are difficult to
> understand:

I suggest having a look at the ECMA-335 as Cecil is borrowing the
naming from it.

> Also, I'm having trouble understand how Resolve() works when used on
> references to generic methods.

Resolve returns a definition, that by definition is not instantiated.

> I have a method like (C#): T GetComponent<T>()
> I have a reference to it: !!0 GetComponent<Faction>()
> the ElementMethod of this reference is: !!0 GetComponent()
> But when I resolve any of the above the above, I get the definition: T
> GetComponent()
>
> If I then have the following code:
>
>> var instMethod = new GenericInstanceMethod(resolvedMethodDefinition);
>> instMethod.GenericArguments.Add(...) //fully parameterize it
>
>
> instMethod is still:
>
>> T GetComponent<Faction>()
>
>
> This return type seems unresolved, and when I run the assembly, it doesn't
> function properly due to TypeLoadExceptions and InvalidProgramException
> about invalid IL.

That doesn't seem to be the issue, il the IL generic parameters are
not replaced by their closed types in signatures.

I suggest running peverify on the resulting assembly to understand the issue.

Jb

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to