[Mono-bugs] [Bug 564088] New: CS0172 incorrectly reported for conditional expression when implicit conversion is available.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Dec 11 12:33:53 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=564088

http://bugzilla.novell.com/show_bug.cgi?id=564088#c0


           Summary: CS0172 incorrectly reported for conditional expression
                    when implicit conversion is available.
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: eylvisaker at physics.ucdavis.edu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:
CS0172 incorrectly reported for a pair of types when one can be implicitly
promoted to the other.

Steps to reproduce the problem:
Compile the following two lines of C# code:
byte x = 4;
byte a = (byte)(true ? x : 0);


Actual Results:
CS0172 reported on the second line.

Expected Results:
Code should compile.  This compiles correctly with MS's C# compiler.  The byte
type (x variable) should be promoted to an integer, so that both types in the
conditional are the same.

How often does this happen? 
Every time.

Additional Information:

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