[Mono-bugs] [Bug 82324][Wis] New - Compilation fails on unsafe delegate initializer.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Aug 4 18:55:02 EDT 2007


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 stapostol at gmail.com.

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

--- shadow/82324	2007-08-04 18:55:02.000000000 -0400
+++ shadow/82324.tmp.1353	2007-08-04 18:55:02.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 82324
+Product: Mono: Compilers
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: Ubuntu Feisty 7.04 (amd64)
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: stapostol at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compilation fails on unsafe delegate initializer.
+
+Description of Problem:
+The following code compiles on csc (.Net 2.0) but fails on gmcs 1.2.4, 
+with error CS0214: "Pointers and fixed size buffers may only be used in an 
+unsafe context"
+
+namespace Bug
+{
+    static class BugClass
+    {
+        unsafe delegate void Foo(void* dummy);
+        static unsafe void FooImplementation(void* dummy) { }        
+        static unsafe Foo Bar = new Foo(FooImplementation);   // Fails
+    }
+}
+
+Steps to reproduce the problem:
+1. Create a new bug.cs code file containing the code above
+2. Compile with 'gmcs /unsafe /target:library bug.cs'
+
+Actual Results:
+"error CS0214: Pointers and fixed size buffers may only be used in an 
+unsafe context"
+
+Expected Results:
+"Compilation succeeded"
+
+
+How often does this happen? 
+Always reproducible.
+
+
+Additional Information:
+Compilation suceeds when you add the 'unsafe' keyword to the containing 
+class, i.e:
+unsafe static class Bug
+{
+[...]
+}


More information about the mono-bugs mailing list