[Mono-bugs] [Bug 411223] gmcs omits constraint of implicit type parameter of inner class

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 27 14:30:57 EDT 2008


User daniel at hofmannmail.ath.cx added comment

Daniel Hofmann <daniel at hofmannmail.ath.cx> changed:

           What    |Removed                                         |Added
            Summary|gmcs emits unverifiable code when using an      |gmcs omits constraint of implicit type parameter
                   |instance of a generic parameter from an outer   |of inner class
                   |type                                            |

--- Comment #2 from Daniel Hofmann <daniel at hofmannmail.ath.cx>  2008-10-27 12:30:57 MDT ---
Ok, I've investigated the problem a bit further, and it boils down to gmcs not
emitting the correct class signature for the inner class. The problem is, that
gmcs correctly lets the inner class have the same type argument as the outer
class, but forgets to let it have the same constraint as well.

Gmcs emits:
class nested private auto ansi beforefieldinit SomeTReferencingInnerClass<T>
        extends [mscorlib]System.Object

Changing to:
class nested private auto ansi beforefieldinit
SomeTReferencingInnerClass<(class SomeBaseClass) T>
        extends [mscorlib]System.Object

and reassembling using:
ilasm /dll /output:test_mod.dll test.dis

lets the code pass through PEVerify.

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