[Mono-bugs] [Bug 420386] New: [regression] nullable Drawing. Color set to null fails comparision to other colors

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 26 10:10:07 EDT 2008


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


           Summary: [regression] nullable Drawing.Color set to null fails
                    comparision to other colors
           Product: Mono: Compilers
           Version: 2.0
          Platform: x86-64
               URL: http://www.go-mono.com/archive/2.0/
        OS/Version: Kubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: silk at boktor.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=235524)
 --> (https://bugzilla.novell.com/attachment.cgi?id=235524)
Unit tests for described behavior. TestNullColor1 and 2 fails, others works as
expected.

1. Code:
using System;
using System.Drawing;

public class NullableColorTests
{
    public static void Main ()
    {
        Color? col = null;
        Console.WriteLine (col == Color.Red);
    }

}

2. Expected output: false
3. Actual output: true

4. Works as expected in MS .NET and mono(gmcs) 1.9.1

This depend on the compiler used, not the runtime, ie. compiled with gmcs 1.9.1
works as expected on runtime 1.9.1 and 2.0; compiled with gmcs 2.0 fail on all
1.9.1, 2.0 and ms .net.

Mono 2.0 branch, revision: 111525

Attaching unit tests. TestNullColor1 and TestNullColor2 fails on 1.9.1.
When Color type is replaced with int, everything works as expected.


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