Update:

It looks like it's because of this code inside TypeSpecification:

public sealed override TypeReference GetElementType()
{
    return this.element_type
      // this will get the array element type, which isn't what I want
      .GetElementType();
}


Is there another way I can get the info I need?

Thanks.



On Dec 2, 12:07 pm, Jeff Nevins <[email protected]> wrote:
> I have a situation where GetElementType() is returning an unexpected
> value for a reference to a int[]....
>
> specifically for a parameter:
>
> [out] int32[]& ids
>
> var elementType = parameter.ParameterType.GetElementType();
>
> returns System.Int32 type reference, not System.Int32[] type
> reference.
>
> If I do:
> typeof(int[]).MakeByRefType().GetElementType()
>
> it returns System.Int32[], which is what I would expect.
>
> Am I doing something wrong here?
>
> Thanks.

-- 
--
mono-cecil

Reply via email to