https://bugzilla.novell.com/show_bug.cgi?id=355622


           Summary: Compilation fails on unsafe array constructor.
           Product: Mono: Compilers
           Version: 1.2.6
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


The following code fails to compile on mcs/gmcs 1.2.6 (and previous):

$ cat bug.cs
class Bug
{
    unsafe int*[] data = new int*[16];
}

$ gmcs bug.cs /unsafe /target:library
unsafe2.cs(3,33): error CS0214: Pointers and fixed size buffers may only be
used in an unsafe context
Compilation failed: 1 error(s), 0 warnings

It compiles fine on csc.exe (tested on version 2.0).

This problem seems related to bug 324993
(https://bugzilla.novell.com/show_bug.cgi?id=MONO82324), since adding the
"unsafe" specifier to the class itself allows the code to compile:

unsafe class Bug
{
    int*[] data = new int*[16];
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to