[Mono-dev] Patch: Bugfix for a constrained. issue with generic code sharing

Mark Probst mark.probst at gmail.com
Tue Sep 30 15:44:10 EDT 2008


Hey,

Jonathan found a generic code sharing bug connected with the
constrained. prefix, which this patch fixes.  I don't know what the
original reasoning behind the inflation with the class context was, but
it seems to be wrong, since the method is taken out of that class, so
it's already inflated with that class's context.  When handling open
types it becomes a problem, though, like in the test case:

	  constrained. valuetype Gen`1<!T>
          callvirt instance int32 class IGen`1<!T>::bla()

Here the method will be Gen`1<!T>::bla(), with T being the second
generic argument (i.e. !1).  If this method is inflated with the context
of Gen`1<!T> an error occurs because Gen`1<!T> only has one generic
argument.  And even if it had two, it might be the wrong one.

Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: constrained.diff
Type: text/x-patch
Size: 5441 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080930/f0cdb173/attachment-0001.bin 


More information about the Mono-devel-list mailing list