[Mono-bugs] [Bug 78974][Nor] Changed - mcs does not find Brush overloaded ctor

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 1 07:28:45 EDT 2006


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 rharinath at novell.com.

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

--- shadow/78974	2006-07-29 15:39:03.000000000 -0400
+++ shadow/78974.tmp.7577	2006-08-01 07:28:45.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 78974
 Product: Mono: Compilers
 Version: 1.1
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
-Resolution: 
-Severity: 
+Status: RESOLVED   
+Resolution: WONTFIX
+Severity: Unknown
 Priority: Normal
 Component: C#
 AssignedTo: rharinath at novell.com                            
 ReportedBy: marek.safar at seznam.cz               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -58,6 +58,47 @@
 
 How often does this happen? 
 
 100%
 
 Additional Information:
+
+------- Additional Comments From rharinath at novell.com  2006-08-01 07:28 -------
+From my reading, the "applicable" overload is
+
+  public LinearGradientBrush (Rectangle rect, Color color1, Color
+color2, float angle)
+
+However, note that the literal constant 0.0 is of type 'double', and
+there's no implicit constant expression conversion of a double
+constant to float in section 13.1.7 (see also section 14.16).
+
+CSC 2.0 appears to have a bug.  The IL looked like:
+
+    IL_0043:  ldloc.3
+    IL_0044:  ldloc.1
+    IL_0045:  ldloc.2
+    IL_0046:  ldc.i4.0
+    IL_0047:  newobj     instance void
+[System.Drawing]System.Drawing.Drawing2D.LinearGradientBrush::.ctor(valuetype
+[System.Drawing]System.Drawing.Rectangle,
+
+                           valuetype [System.Drawing]System.Drawing.Color,
+
+                           valuetype [System.Drawing]System.Drawing.Color,
+
+                           valuetype
+[System.Drawing]System.Drawing.Drawing2D.LinearGradientMode)
+
+which is way more screwed-up, IMHO :-)  It's treating 0.0 as an
+integer constant (ldc.i4.0), and then choosing the enum.  CSC 1.1 even
+uses:
+
+    IL_0044:  ldc.r8     0.0
+    IL_004d:  conv.i4
+
+All of which seems quite bogus to me.
+
+I'm inclined to say: use 0.0f if you want the right behaviour both on
+MCS and CSC.  The MCS behaviour appears right, and the CSC behaviour
+appears wrong: I don't think we should be bug compatible in this case.
+


More information about the mono-bugs mailing list