[Mono-bugs] [Bug 401012] New: StructLayout and order of partial class files issue

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jun 17 14:26:11 EDT 2008


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


           Summary: StructLayout and order of partial class files issue
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: x86
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: milkob at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=222571)
 --> (https://bugzilla.novell.com/attachment.cgi?id=222571)
Contains test case and command line for compilation

bug1.cs:

[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)] 
public partial struct Bug
{
}

---------------------------------------------------------------------
bug2.cs:

public partial struct Bug
{
  [System.Runtime.InteropServices.FieldOffset(0)]               
  public int Integer;
}

---------------------------------------------------------------------

When I compile it like this: gmcs -t:library bug2.cs bug1.cs 

I get this error:

bug2.cs(4,14): error CS0636: The FieldOffset attribute can only be placed on
members of types marked with the StructLayout(LayoutKind.Explicit)


but if it's compiled: gmcs -t:library bug1.cs bug2.cs

then compilation is successful.


-- 
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.


More information about the mono-bugs mailing list