[Mono-bugs] [Bug 76256][Nor] Changed - UIntPtr should be converted to int

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jan 17 08:34:59 EST 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.


--- shadow/76256	2006-01-17 08:29:14.000000000 -0500
+++ shadow/76256.tmp.22986	2006-01-17 08:34:59.000000000 -0500
@@ -1,13 +1,13 @@
 Bug#: 76256
 Product: Mono: Compilers
 Version: unspecified
 OS: All
 OS Details: 
-Status: NEW   
+Status: RESOLVED   
+Resolution: NOTABUG
 Severity: Unknown
 Priority: Normal
 Component: C#
 AssignedTo: rharinath at novell.com                            
 ReportedBy: kornelpal at hotmail.com               
 QAContact: mono-bugs at ximian.com
@@ -22,6 +22,27 @@
 Actual result:
 error CS0030: Cannot convert type 'int' to 'System.UIntPtr'
 Expected result:
 No error.
+------- Additional Comments From rharinath at novell.com  2006-01-17 08:34 -------
+I believe that this is not a bug in MCS, but in CSC, which probably
+has over-eager constant propagation.
+Basically, the available user-defined conversion operators from
+integral types to UIntPtr are
+  uint  -> UIntPtr
+  ulong -> UIntPtr
+There is _no_ "standard explicit conversion" (sec. 13.3.2) from int to
+uint, nor to ulong.  Thus the following casts
+  int -> uint  -> UIntPtr
+  int -> ulong -> UIntPtr 
+_cannot_ be performed.
+(Note that there are standard explicit conversions from constants to
+uint and ulong, depending on the value of the constant)

More information about the mono-bugs mailing list