[Mono-bugs] [Bug 58624][Nor] New - mcs doesn't catch properties returning pointers in safe context

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 17 May 2004 22:49:16 -0400 (EDT)


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 vladimir@pobox.com.

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

--- shadow/58624	2004-05-17 22:49:16.000000000 -0400
+++ shadow/58624.tmp.17328	2004-05-17 22:49:16.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 58624
+Product: Mono: Compilers
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs doesn't catch properties returning pointers in safe context
+
+The following code:
+
+== frob.cs ==
+using System;
+public class Driver {
+  public static unsafe byte* Frob {
+    get { return (byte *) 0; }
+  }
+  
+  public static void Main () {
+    IntPtr q = (IntPtr) Frob;
+  }
+}
+
+Results in:
+
+mcs /unsafe frob.cs
+frob.cs(11) error CS0030: Cannot convert type 'byte*' to 'void*'
+frob.cs(11) error CS0030: Cannot convert type 'byte*' to 'System.IntPtr'
+
+instead of "pointers may not be used without unsafe context" (as csc
+resports).  It works fine if Frob is a method call.