[Mono-bugs] [Bug 474194] New: False compilation error by mcs/gmcs

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 9 23:59:27 EST 2009


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


           Summary: False compilation error by mcs/gmcs
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.2.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Chuck.Esterbrook at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US;
rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6

The following program compiles and runs on Novell Mono 2.0 using gmcs and mcs.
It also compiles and runs on Microsoft C# 2008.

But on Mono 2.2, both gmcs and mcs give a false compilation error:

foo.cs(4,28): error CS1012: Too many characters in character literal

class X {
    public static void Main() {
        bool b = false;
        A((b?A("x'a."):A("x")));
    }
    static bool A(object obj) {
        return true;
    }
}

Note that the slightest tweak to the complex expression often resolves the
problem. For example, changing "b" to "false", or removing the extra parens
inside A(...) makes the false error go away.

This is a serious problem in my project where this happens more than once. The
above example is a distillation that is as close to minimal as I could get.


Reproducible: Always

Steps to Reproduce:
See details.

Actual Results:  
foo.cs(4,28): error CS1012: Too many characters in character literal

Expected Results:  
No error, as with Mono 2.2 and .NET 3.5.

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