2009-07-11 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / tests / gtest-452.cs
1 // Compiler options: -langversion:future
2
3 using System;
4
5 struct S
6 {
7 }
8
9 public class C
10 {
11         static void Foo<T> (T t, T u = default (T))
12         {
13         }
14
15         static void TestParams (params int[] i)
16         {
17                 throw new ApplicationException ();
18         }
19
20         static void TestParams (int i = 4)
21         {
22         }
23
24         static void TestStruct (S? s = new S ())
25         {
26         }
27         
28         public string this [int i, string s = "test"] {
29                 get { return s; }
30                 set { value = s; }
31         }
32
33         public static int Main ()
34         {
35                 Foo ("f");
36                 Foo (2);
37                 Foo (2, 4);
38                 Foo<long> (2);
39                 Foo<string> ("2", "3");
40                 
41                 TestParams ();
42                 
43                 TestStruct ();
44                 
45                 C c = new C ();
46                 if (c [1] != "test")
47                         return 1;
48                 
49                 c [3] = "value";
50                 
51                 return 0;
52         }
53 }