Update dependencies from https://github.com/dotnet/arcade build 20190729.1 (#15881)
[mono-project.git] / mcs / tests / gtest-implicitarray-01.cs
blob8716fe1fa418053e9f8ffe6a15e531c4c8e89c25
2 // Tests implicitly typed arrays
4 public class Test
6 public static int Main ()
8 string[] array = new [] { "Foo", "Bar", "Baz" };
9 foreach (string s in array)
10 if (s.Length != 3)
11 return 1;
13 string[] s1 = new[] { null, "a", default (string) };
14 double[] s2 = new[] { 0, 1.0, 2 };
16 var a1 = new[] { null, "a", default (string) };
17 var a2 = new[] { 0, 1.0, 2 };
18 var a3 = new[] { new Test (), null };
19 var a4 = new[,] { { 1, 2, 3 }, { 4, 5, 6 } };
20 var a5 = new[] { default (object) };
21 var a6 = new[] { new [] { 1, 2, 3 }, new [] { 4, 5, 6 } };
23 const byte b = 100;
24 int[] a7 = new[] { b, 10, b, 999, b };
26 var a8 = new[] { new Test (), 22, new object(), string.Empty, null };
28 int[] a9 = new [] { 1, (byte) 1 };
30 return 0;