[System.Data] use PAL_gssapi.c for SSPI (#9922)
[mono-project.git] / mcs / tests / gtest-optional-04.cs
blob5cc5ecb5a61ebca01519590202d11d7038bf483e
1 using System;
3 public struct S
7 public class C
9 static void Foo<T> (T t, T u = default (T))
13 static void TestParams (params int[] i)
15 throw new ApplicationException ();
18 static void TestParams (int i = 4)
22 static void TestParams2 (string s, params int[] i)
24 throw new ApplicationException ();
27 static void TestParams2 (string s, int i = 4)
31 static void TestStruct (int? s = new int ())
33 if (!s.HasValue)
34 throw new ApplicationException ("TestStruct");
37 static void TestStruct2 (S? s = new S? ())
41 public string this [int i, string s = "test"] {
42 get { return s; }
43 set { value = s; }
46 public static int Main ()
48 Foo ("f");
49 Foo (2);
50 Foo (2, 4);
51 Foo<long> (2);
52 Foo<string> ("2", "3");
54 TestParams ();
55 TestParams2 ("a");
57 TestStruct ();
58 TestStruct2 ();
60 C c = new C ();
61 if (c [1] != "test")
62 return 1;
64 c [3] = "value";
66 return 0;