[Mono-bugs] [Bug 72899][Nor] New - Compiler message: "'short' and 'int' implicitly convert to each other"
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 23 Feb 2005 05:47:23 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by dezelin@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=72899
--- shadow/72899 2005-02-23 05:47:23.000000000 -0500
+++ shadow/72899.tmp.4836 2005-02-23 05:47:23.000000000 -0500
@@ -0,0 +1,72 @@
+Bug#: 72899
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details: Fedora Core 3; Mono-1.1.4 build from source
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: dezelin@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Compiler message: "'short' and 'int' implicitly convert to each other"
+
+Description of Problem:
+
+When I try to compile the submitted test case compiler gives me the
+following error which (I think) is wierd:
+
+CS0172-test.cs(11) error CS0172: Can not compute type of conditional
+expression as `int' and `short' convert implicitly to each other
+Compilation failed: 1 error(s), 0 warnings
+
+'int' and 'short' do __not__ implicitly convert to each other!
+
+
+Steps to reproduce the problem:
+
+Compile test case:
+
+mcs -g -d:DEBUG,TRACE -t:exe -out:CS0172-test.exe -r:System CS0172-test.cs
+
+
+Actual Results:
+
+Error:
+
+CS0172-test.cs(11) error CS0172: Can not compute type of conditional
+expression as `int' and `short' convert implicitly to each other
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+Proper code generation or proper error message printed.
+
+How often does this happen?
+Always
+
+
+Additional Information:
+
+Test case:
+
+
+using System;
+
+namespace CS0172_TestCase
+{
+ public class Test
+ {
+ public static void Main()
+ {
+ short s = 5;
+ int i = 345;
+ short flag = (s < i) ? 0 : s;
+ }
+ }
+}