[mono-vb] Multi-dim arrays of structures

John Lenz jlenz2 at math.uiuc.edu
Thu Apr 8 14:02:05 EDT 2010


The following code was giving me a 9997 error.

Public Class Main

   Public Structure Foo
     Public T As Integer
   End Structure

   Public Shared Sub Main()
     Dim b(,) As Boolean = { {True,False}, {False,False}}

     Dim f(2, 2) As Foo
     f(1,2).T = 5

   End Sub

End Class

I looked at the IL produced by gmcs for equivalent C# code and found 
gmcs was using a virtual call to the Address method.  The attached patch 
fixes the problem for me.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vb-array.diff
Type: text/x-diff
Size: 2853 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-vb/attachments/20100408/8f02ddb4/attachment.bin 

More information about the Mono-vb mailing list