Page 1 of 1

typeof(OpenGenericType<,>) in cobra

PostPosted: Sat Jan 09, 2010 9:05 am
by gauthier
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?

Re: typeof(OpenGenericType<,>) in cobra

PostPosted: Sun Jan 10, 2010 12:10 am
by Charles
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

Re: typeof(OpenGenericType<,>) in cobra

PostPosted: Sun Jan 10, 2010 2:51 am
by gauthier
Hi Chuck, I just created ticket 192.

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

Re: typeof(OpenGenericType<,>) in cobra

PostPosted: Sat Jul 03, 2010 1:17 am
by Charles
Btw this was fixed some time ago after the ticket was created. Thanks for the report.