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:
>
> /*
> VS.NET:
> OK
>
> Mono C# compiler version 1.0.0.0 (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 = new int[3][,];
> mb = (int[][,])mb;
> return 0;
> }
> }
--
Tomar <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part
