[Mono-bugs] [Bug 469244] New: CS1525 Unexpected Symbol '?' incorrectly reported as compilation error.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jan 25 16:31:07 EST 2009


           Summary: CS1525 Unexpected Symbol '?' incorrectly reported as
                    compilation error.
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.2.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jason at tnjconsulting.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

A compilation error occurs when using a ternary operator with a Nullable class
instantiation using the 'xx?' construct instead of the Nullable<xx> construct.

Reproducible: Always

Steps to Reproduce:
1. instantiate a nullable type using the question mark form instead of the
angle brackets form inside of a ternary operator.
Actual Results:  
dev/mono/test.cs(19,62): error CS1525: Unexpected symbol `?'

Expected Results:  
The file should compile without errors.

In the attached file, the code causing the compilation error is indicated. As
you can see, instantiation of a Nullable type using ? by itself is not the
problem, nor is the ternary operator with the nullable type instantiated using
Nullable<> is not the problem.

This works in the Microsoft C# compiler.

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