Typed Array type

Topics: Metadata Model
Dec 1, 2010 at 6:49 PM

Hello.

How do I create a typed array type, like typeof(string[])?

Thanks.

Coordinator
Dec 1, 2010 at 6:51 PM

In what context? A custom attribute, or a during execution?

Dec 1, 2010 at 7:11 PM
Edited Dec 1, 2010 at 7:13 PM

Comparison with other types, for example matching the signature of a method.

To be more clear, because I probably wasn't enough, I don't need to create the CCI expression for typeof(string[]). I need to have the CCI representation of that type string[], the ITypeDefinition for string[].

 

 

Dec 1, 2010 at 7:34 PM
Edited Dec 1, 2010 at 7:36 PM

If I understand correctly it's VectorTypeReference.

I can create a reference with Microsoft.Cci.MutableCodeModel.VectorTypeReference. In case I need the definition I should use the ResolvedType property. But for matching the reference should be enough.

Coordinator
Dec 1, 2010 at 8:08 PM

MetadataHelper has a class Vector that implements a factory method GetVector that will return an ojbect that implements IArrayTypeReference.

Dec 1, 2010 at 9:15 PM

Thanks. I didn't think of looking for "vector".

(I suspect "vector" is also incorrect but I guess CCI is just following the CLR naming.)