[Mono-bugs] [Bug 444235] New: incorrect consideration of generic constraints

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 12 11:05:40 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=444235


           Summary: incorrect consideration of generic constraints
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: wasabi at larvalstage.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following code compiles in MS.Net, but not in gmcs as of the 2.2 branch. It
does compile correctly in at least 1.9, which I have on hand; and I believe 2.0
which I think I had working yesterday.


using System;

namespace Test
{

    public interface IFoo
    {

    }

    public class Foo : IFoo
    {

    }

    public interface IBase
    {

        T Get<T>(object o);

    }

    public class TestClass : IBase
    {

        public T Get<T>(object o)
            where T : IFoo
        {
            return default(T);
        }

        T IBase.Get<T>(object o)
        {
            return default(T);
        }

        public static void Main(string[] args)
        {
            Console.WriteLine(new TestClass().Get<Foo>(null));
        }

    }

}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list