[Mono-bugs] [Bug 421737] New: [GMCS] Interfaces implemented by type argument ignored for Nullable<T>

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Aug 30 12:36:07 EDT 2008


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

User gert.driesen at pandora.be added comment
https://bugzilla.novell.com/show_bug.cgi?id=421737#c1

           Summary: [GMCS] Interfaces implemented by type argument ignored
                    for Nullable<T>
           Product: Mono: Compilers
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


To reproduce, compile and run the following code:

using System;
using System.IO;

class Program
{
        static void Main ()
        {
                int? a = 5;
                int? b = 7;

                Console.WriteLine (AreEqual (a, b));
                Console.WriteLine (AreEqual (a, a));
        }

        static bool AreEqual (IComparable x, IComparable y)
        {
                return x.CompareTo (y) == 0;
        }
}

Expected result:

False
True

Actual result:

test.cs(11,36): error CS1502: The best overloaded method match for
`Program.AreEqu
al(System.IComparable, System.IComparable)' has some invalid arguments
test.cs(14,21): (Location of the symbol related to previous error)
test.cs(11,36): error CS1503: Argument `#1' cannot convert `int?' expression to
ty
pe `System.IComparable'
Compilation failed: 2 error(s), 0 warnings


-- 
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