diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 17b70d5630840..336d14f881154 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -299,6 +299,7 @@ TEST_CS2_SRC = \ bug-80392.2.cs \ dynamic-method-access.2.cs \ bug-82194.2.cs \ + anonarray.2.cs \ generic_type_definition.2.cs TEST_IL2_SRC = find-method.2.il \ diff --git a/mono/tests/anonarray.2.cs b/mono/tests/anonarray.2.cs new file mode 100644 index 0000000000000..e1ce40f051db8 --- /dev/null +++ b/mono/tests/anonarray.2.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +class Program { + public static void Main() + { + // this form of initialisation causes a crash when I try + // to iterate through the items. + IEnumerable> table + = new string[][] { + new string[] { "1a", "1b" }, + new string[] { "2a", "2b" } + }; + + foreach (IEnumerable row in table) { + foreach (string cell in row) { + Console.Write("{0} ", cell); + } + Console.WriteLine(); + } + } +}