Hey,

On 6/21/07, Max Bolingbroke <[EMAIL PROTECTED]> wrote:
> MethodReference constructorReference = new
> MethodReference(Constructors.InstanceConstructorName,
> parameter.ParameterType, module.Import(typeof(void)), true, false,
> MethodCallingConvention.Default);

You can use MethodDefinition.Ctor instead of your
Constructor.InstanceConstructorName if you want.

> However, I assume this is the intended behaviour. I have managed to fix
> my code now by using the ElementType you mentioned.. I had assumed (from
> the name) that it was only for the TypeReference of the elements of
> arrays (e.g. int for int[]), and this was further reinforced by the fact
> that it was declared not on GenericInstanceType but on TypeSpecification.

Ah yeah this is intended. Cool, it means that somehow it's working :)

TypeSpecification is extended by a few types, like PointerType,
ReferenceType, SentinelType, FunctionPointerType, GenericInstanceType,
ArrayType, ModType family, and a few others, so you can chain types,
for cases like List<int[]>.

-- 
Jb

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

Reply via email to