[Mono-bugs] [Bug 69921][Blo] New - mcs can't convert null to a pointer type

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 25 Nov 2004 15:27:49 -0500 (EST)


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 vargaz@gmail.com.

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

--- shadow/69921	2004-11-25 15:27:49.000000000 -0500
+++ shadow/69921.tmp.2806	2004-11-25 15:27:49.000000000 -0500
@@ -0,0 +1,45 @@
+Bug#: 69921
+Product: Mono: Compilers
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs can't convert null to a pointer type
+
+Testcase:
+
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+using System;
+
+unsafe class X {
+
+	unsafe public X (sbyte *value, int startIndex, int length) {
+	}
+
+	static void Main ()
+	{
+		new X ((sbyte*)null, 0, 10);
+	}
+}
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+This compiles fine with csc, while mcs says:
+bug.cs(10) error CS1502: The best overloaded match for method ' X..ctor
+(sbyte*, int, int)' has some invalid arguments
+bug.cs(10) error CS1503: Argument 0: Cannot convert from 'object' to 'sbyte*'
+bug.cs(10) error CS1501: No overload for method `X' takes `3' arguments
+bug.cs(10) error CS1501: New invocation: Can not find a constructor in `X'
+for this argument list
+
+This is a regression and it prevents compilation/running of the corlib test
+ suite.