[Mono-dev] CS0411 error with nullable enum

Tom Philpot tom.philpot at logos.com
Tue Jul 21 00:29:59 EDT 2009


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);
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090720/a7f592d0/attachment.html 


More information about the Mono-devel-list mailing list