Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

37 lines
681 B
C#

using System;
namespace mono_bug
{
class Program
{
public static void Main ()
{
// initialise so no null errors
double [,] [] foo = new double [1, 1] [];
foo [0, 0] = new double [2];
double [,] [] bar;
bar = (double [,] []) foo.Clone ();
bar = (double [,] []) ReturnArray ();
// compiles & works correctly
bar = ReturnArray ();
Console.WriteLine (bar [0, 0] [1].ToString ());
}
private static double [,] [] ReturnArray ()
{
// just creates a "useless", multi-dimensional jagged array
double [,] [] zoo = new double [1, 1] [];
zoo [0, 0] = new double [2];
zoo [0, 0] [0] = 1;
zoo [0, 0] [1] = 2;
return zoo;
}
}
}