Forums

typeof(OpenGenericType<,>) in cobra

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

typeof(OpenGenericType<,>) in cobra

Postby gauthier » Sat Jan 09, 2010 9:05 am

how do I express open generic type System.Type initializers?

I could do that with c#:

Code: Select all
var opengenerictype = typeof(OpenGenericType<,>);


is there something similar in cobra?
gauthier
 
Posts: 116

Re: typeof(OpenGenericType<,>) in cobra

Postby Charles » Sun Jan 10, 2010 12:10 am

The general Cobra format is "t = TYPE" such as "t = String" or "t = List<of int>". As you discovered, "t = List<of>" or "t = Dictionary<of,>" is not currently supported.

Can you fill out a ticket for that?

In the meantime, here is a workaround:
t = sharp'typeof(System.Collections.Generic.List<>)' to Type
trace t
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: typeof(OpenGenericType<,>) in cobra

Postby gauthier » Sun Jan 10, 2010 2:51 am

Hi Chuck, I just created ticket 192.

This feature is particulary usefull in IOC container setup via API or for easy type filtering
gauthier
 
Posts: 116

Re: typeof(OpenGenericType<,>) in cobra

Postby Charles » Sat Jul 03, 2010 1:17 am

Btw this was fixed some time ago after the ticket was created. Thanks for the report.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 80 guests