[Mono-bugs] [Bug 76741][Wis] New - No runtime support for nullable types

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Nov 17 19:48:31 EST 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 bmaurer at users.sf.net.

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

--- shadow/76741	2005-11-17 19:48:31.000000000 -0500
+++ shadow/76741.tmp.3365	2005-11-17 19:48:31.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 76741
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bmaurer at users.sf.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: No runtime support for nullable types
+
+Consider this test case:
+
+class X {
+	static void Main ()
+	{
+		System.Console.WriteLine (Z<int?> (1));
+		System.Console.WriteLine (Z<int?> (null));
+	}
+
+	static T Z <T> (object o) {
+		return (T) o;
+	}
+}
+
+Microsoft prints:
+
+1
+<blank line>
+
+In Z<T>, when T=int?, the cast will unbox an int, and if o is null, return
+an int? with no value.
+
+I executed the code that GMCS generates for this on Microsoft's framework,
+and it works fine, so this is a runtime issue.


More information about the mono-bugs mailing list