[Mono-bugs] [Bug 613939] New: Addition of int literal and null doesn't yield null

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jun 14 06:30:51 EDT 2010



           Summary: Addition of int literal and null doesn't yield null
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.6.x
          Platform: i686
        OS/Version: UNIX Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: wrar at wrar.name
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=368922)
 --> (http://bugzilla.novell.com/attachment.cgi?id=368922)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.9
(KHTML, like Gecko) Chrome/6.0.401.0 Safari/533.9

All arithmetic operations with nulls yield null and give warning CS0458, but in
mono 2.6.4 additions of int literals and nulls behave as if null == 0.

Attached test program compiles without warnings on Mono and outputs "a = 1",
while on .NET 2.0 and 4.0 it compiles with CS0458 in 6th line and outputs "a is

This behavior is reproduced by "1 + null" and "null + 1", not with "1 - null"
or "int a = 1; a + null".

Reproducible: Always

Steps to Reproduce:

Configure bugmail: http://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