Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Jb Evain
Hi Matej, Matej Urbas wrote: I'm working on code completion (generics support) in MonoDevelop and I'm making extensive use of Mono.Cecil. Great news! 2. Question about methods that have generic types as parameters: Here is an example of such a method: static T System.Array.FindLast T

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Matej Urbas
On Mon, 2006-07-24 at 11:20 +0200, Jb Evain wrote: You can find constructed generic types (GenericInstanceType) and constructed generic methods (GenericInstanceMethod). They both implement IGenericInstance wich provides a collection of argument. An argument is a TypeReference, which is the

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Jb Evain
Hi, Matej Urbas wrote: I have one question though: Suppose we have such a TypeReference: SomeType`2int, T[][] Here is what I do to get all info about SomeType`2 out of there: I have a loop that goes like this: Check if the TypeReference is of any of these types: 1. ArrayType 2.

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Matej Urbas
Hey! On Mon, 2006-07-24 at 12:33 +0200, Jb Evain wrote: There is a simpler way. The inheritance tree is like this: - TypeReference - TypeSpecification - ArrayType - PointerType - ReferenceType - FunctionPointerType - GenericInstanceType - ModType

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Matej Urbas
On Mon, 2006-07-24 at 11:20 +0200, Jb Evain wrote: 3. Oh, and to what extent is Mono.Cecil compatible with System.Reflection? E.g.: are the Mono.Cecil.GenericParamAttributes and System.Reflection.GenericParameterAttributes cast safe? - I mean, can they be cast from one-another and still

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Jb Evain
Hey, Matej Urbas wrote: I figured that they are 'compatible'. But there is one slight difference. You are missing a 'n' in DefaultConstructorConstraint :D This is fixed in SVN. Jb ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-24 Thread Matej Urbas
On Mon, 2006-07-24 at 14:22 +0200, Jb Evain wrote: Hey, Matej Urbas wrote: I figured that they are 'compatible'. But there is one slight difference. You are missing a 'n' in DefaultConstructorConstraint :D This is fixed in SVN. Oh, sorry about that. Yep, we are using an old copy in

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-23 Thread Matej Urbas
On Sun, 2006-07-23 at 12:32 -0400, Miguel de Icaza wrote: The complete specification for this syntax is available on the ECMA 335 specification: http://www.ecma-international.org/publications/standards/Ecma-334.htm Thank you. I have also found the answer to the second question: it is not

[Mono-dev] Mono.Cecil: Full names of generic types

2006-07-22 Thread Matej Urbas
Hi I'm working on code completion (generics support) in MonoDevelop and I'm making extensive use of Mono.Cecil. I have a few questions about the way Mono.Cecil decorates full names of generic types: 1. All generic types have such a string appended to their full name: `# - where # represents

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-22 Thread Alejandro Serrano
--- Matej Urbas [EMAIL PROTECTED] escribió: Hi I'm working on code completion (generics support) in MonoDevelop and I'm making extensive use of Mono.Cecil. I have a few questions about the way Mono.Cecil decorates full names of generic types: 1. All generic types have such a

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-22 Thread Matej Urbas
On Sat, 2006-07-22 at 16:29 +0200, Alejandro Serrano wrote: Decorating generic types with a grave (`) and the number of generic parameters is the way the CLI represents generic types, so we could have: FuncA = Func`1A FuncA, B = Func`2A, B because the runtime imposes that all types

Re: [Mono-dev] Mono.Cecil: Full names of generic types

2006-07-22 Thread Miguel de Icaza
1. All generic types have such a string appended to their full name: `# - where # represents the number of generic parameters. Is this a standard way of decorating generic names? If it is, can you point me to a document that specifies this? (I need it mostly because I'm interested, but I