[Mono-bugs] [Bug 399269] New: gmcs and visual c# compiler behave differently on priority of ?? operator

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 11 09:33:30 EDT 2008


           Summary: gmcs and visual c# compiler behave differently on
                    priority of ?? operator
           Product: Mono: Compilers
           Version: SVN
          Platform: x86
        OS/Version: UNIX Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: nevor at nevor.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other

Description of Problem:
The = operator has priority over ?? operator with the mono C# compiler whereas
with the ms visual C# compiler it has not. 

Steps to reproduce the problem:
1. Put this code into a cs source file.

using System;

public class Program
    public static int Main()
        int? foo = null;
        int foo2 = 2;
        Console.WriteLine(foo ?? foo2 = 3);

        return 0;

2. Compile without flags with gmcs (version and and csc 
( version 8.00.50727.1433 and  version 3.5.21022.8)

Actual Results:
With gmcs : The file compile with 1 warning
With csc : The compilation abort with the error 
"c:\Users\Nevor\Projects\Testes\priority.cs(9,27): error CS0131: The left-hand
side of an assignment must be a variable, property or indexer"

Expected Results:
gmcs abort compilation with the same error.

How often does this happen? 

Additional Information:

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