[Mono-bugs] [Bug 76568][Min] New - mcs does not respect explicit casting of null

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Oct 27 07:23:38 EDT 2005

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 atsushi at ximian.com.


--- shadow/76568	2005-10-27 07:23:38.000000000 -0400
+++ shadow/76568.tmp.3537	2005-10-27 07:23:38.000000000 -0400
@@ -0,0 +1,43 @@
+Bug#: 76568
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Minor
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: mcs does not respect explicit casting of null
+mcs reject to compile explicit cast of null to a certain type.
+using System;
+public class Test
+        public static void Main ()
+        {
+                bool ret = (DBNull) null == null;
+        }
+Actual Results:
+const-null.cs(6,15): error CS0031: Constant value `System.DBNull' cannot be
+converted to a `int'
+const-null.cs(6,15): error CS0037: Cannot convert null to `int' because it
+is a value type
+Expected Results:
+no error.
+How often does this happen? 

More information about the mono-bugs mailing list