[Mono-list] mcs bug, chokes on multidimensional array

Tomar tomar@apricot.com
Sun, 15 Aug 2004 11:06:42 -0500

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This appears to be a mcs specific "bug".  Mono itself seems to handle
the il from jagged arrays just fine.

The problem itself appears to be something with the way jagged arrays
are used "behind the scenes".  The compilers in both cases will generate
the il for "mb" as a type "int32[,][]".  This would follow that the
error from mcs is somewhat correct: casting a "int32[,][]" to a
"int32[][,]" is not possible.  The csc compiler just appears to ignore
the cast (or realize its unnecessary since its "same type" to "same
type" casting?) and just does a "ldloc.0/stloc.0" while the mcs compiler
tries to generate a cast which fails if done explicitly.

As an aside, I hate the use of jagged arrays. :-)

Tom Larsen

On Sat, 2004-08-14 at 10:06, Antony Lesuisse wrote:
> I think i've found a bug in mcs 1.0, confirmed by checking in vs.net.
> Here is the test:
> /*
>     OK
> Mono C# compiler version (from debian package):
>     mcs: tmp.cs(28) error CS0030: Cannot convert type 'int[,][]' to 'int[=
> */
> using System;
> class ArrayBug {
>     public static int Main(String[] args) {
>         int[][,] mb =3D new int[3][,];
>         mb =3D (int[][,])mb;
>         return 0;
>     }
> }
Tomar <tomar@apricot.com>

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.4 (GNU/Linux)