[Mono-list] Generics not working
Rodrigo Kumpera
kumpera at gmail.com
Mon Aug 10 08:40:30 EDT 2009
Please file a bug report on this.
On Mon, Aug 10, 2009 at 9:37 AM, Gotisch <gotisch at gmail.com> wrote:
>
> Following code doesnt compile under Mono JIT compiler version 2.4 (tarball
> So
> 9. Aug 02:55:46 CEST 2009) but seems to work under .NET are generics
> implement in another fashion?
> Here the fix seems easy (not using the Singletonholder class just using the
> variable directly) but there are other Generics constructs in the app i
> want
> port from .net to mono that also throw errors.
> using System;
>
> namespace test
> {
> public class TestClass<T> where T : new()
> {
>
> public TestClass()
> {
>
> }
> public T Instance {
> get { return SingletonHolder<T>.Instance; }
> }
> static class SingletonHolder<TSingle> where TSingle : new()
> {
> internal static readonly TSingle Instance = new
> TSingle();
> }
> }
> }
>
>
> --
> View this message in context:
> http://www.nabble.com/Generics-not-working-tp24893978p24893978.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090810/8196ed04/attachment.html
More information about the Mono-list
mailing list