This compiled fine for me using 2.4.2.1 using System; using System.Collections.Generic;
namespace Test { public enum Enum { One, Two } class CompilerTest { public static void Main(string[] s) { ThisDoesNotWork(); } protected static int DoSomething<T>(string s, T t, ref T t2) { Console.WriteLine("s={0}", s); Console.WriteLine("t={0}", t.ToString()); Console.WriteLine("t2={0}", t2.ToString()); t2 = default(T); return 0; } // .NET 3.5 infers Enum from T, Mono is confused public static void ThisDoesNotWork() { // Nullable does not work Enum? e = Enum.One; DoSomething("abc", Enum.Two, ref e); } public static void ThisWorksFine() { Enum e = Enum.Two; DoSomething("abc", Enum.Two, ref e); Console.WriteLine("e={0}", e.ToString()); } } } ________________________________ From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf Of Tom Philpot Sent: Tuesday, July 21, 2009 12:30 AM To: mono-devel-l...@ximian.com Subject: [Mono-dev] CS0411 error with nullable enum One more generics error for you all. The following compiles on Windows .NET, but Mono seems to have issues. Again, this is compiling against SVN HEAD. I'll file a Bugzilla report in the morning. Tom using System; using System.Collections.Generic; namespace Test { public enum Enum { One, Two, } class CompilerTest { protected static int DoSomething<T>(string s, T t, ref T t2) { return 0; } // .NET 3.5 infers Enum from T, Mono is confused public static void ThisDoesNotWork() { // Nullable does not work Enum? e = Enum.One; DoSomething("abc", Enum.Two, ref e); } public static void ThisWorksFine() { Enum e = Enum.One; DoSomething("abc", Enum.Two, ref e); } } } ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list