2009-09-24 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / gtest-452.cs
blob192277cea08795e82eded0a1ba2b7532d68da1f1
1 // Compiler options: -langversion:future
3 using System;
5 struct S
9 public class C
11 static void Foo<T> (T t, T u = default (T))
15 static void TestParams (params int[] i)
17 throw new ApplicationException ();
20 static void TestParams (int i = 4)
24 static void TestStruct (S? s = new S ())
28 public string this [int i, string s = "test"] {
29 get { return s; }
30 set { value = s; }
33 public static int Main ()
35 Foo ("f");
36 Foo (2);
37 Foo (2, 4);
38 Foo<long> (2);
39 Foo<string> ("2", "3");
41 TestParams ();
43 TestStruct ();
45 C c = new C ();
46 if (c [1] != "test")
47 return 1;
49 c [3] = "value";
51 return 0;