[Mono-bugs] [Bug 61055][Min] New - error cs0172: cant compute type of conditional expr

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 2 Jul 2004 07:17:14 -0400 (EDT)


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 thlsmith@iprimus.com.au.

http://bugzilla.ximian.com/show_bug.cgi?id=61055

--- shadow/61055	2004-07-02 07:17:14.000000000 -0400
+++ shadow/61055.tmp.17477	2004-07-02 07:17:14.000000000 -0400
@@ -0,0 +1,32 @@
+Bug#: 61055
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: thlsmith@iprimus.com.au               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: error cs0172: cant compute type of conditional expr
+
+Description of Problem:
+I have a class with the following code in it:
+
+private static short[] Conditional_production = {0,4,64,166,187};
+
+private static short get_conditional_production ( short symbol )
+{ return (short) ( symbol > 2186 ? Conditional_production [symbol - 2186] :
+0 ); }
+
+mcs gives the following error for the above code
+c__Parser.cs(10) error CS0172: Can not compute type of conditional
+expression as `short' and `int' convert implicitly to each other
+
+I'm using mcs version 0.96.0.0