[Mono-bugs] [Bug 412306] New: Missing System. TypeLoadException exception for types with explicit layout

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 25 14:22:33 EDT 2008


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


           Summary: Missing System.TypeLoadException exception for types
                    with explicit layout
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: generics
        AssignedTo: rkumpera at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


1. compile using gmcs at least r108800

using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Explicit)]
public struct S<T>
{
        public void Foo ()
        {
        }
}

class T
{
        public static void Main ()
        {
                S<int> i;
                i.Foo ();
        }
}

2. run

Expected result:

Unhandled Exception: System.TypeLoadException: Could not load type 'S`1' from
assembly 'bug-1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because
generic types cannot have explicit layout.

Actual result:

No error.


3. run verifier


Expected results:

[MD]: Error: TypeDef is generic but has explicit layout. [token:0x02000002]
[MD]: Error: Value class has neither fields nor size parameter.
[token:0x0200000
2]

Actual results:

No error.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list