Hey,
On 9/28/08, Chris Howie <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 28, 2008 at 11:52 AM, DraconisBG <[EMAIL PROTECTED]> wrote:
> > I got a task where I have to modify Mono/GMCS in order to make the
> following
> > possible:
> >
> > ------------------------------------------------
> > public void GenericMethod<T> (...) {...}
> >
> > ...
> >
> > System.Type typ = <expression that evaluates to a type>;
> > GenericMethod<typ> (...);
> >
> > ------------------------------------------------
>
>
> Uhm, this is already possible and working, and has been for (IIRC)
> several releases.
Not it's not. Here `typ' is a System.Type instance, and thus, can't be
used as a generic argument for the GenericMethod.
But to me, it seems that here, the whole JIT/gmcs modification is a
little bit too much. Especially as you can use something like a linq
expression tree to create a dynamic method that will call the generic
method with the dynamically retrieved type.
You won't lose too much of performances because of the DynamicMethod
used to compile the expression tree.
--
Jb Evain <[EMAIL PROTECTED]>
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list