Merge branch 'master' of github.com:mono/mono
[mono.git] / mcs / tests / gtest-optional-11.cs
1 using System;
2 using System.Reflection;
3 using System.Runtime.InteropServices;
4
5 public class C
6 {
7         public static int TestA ([Optional][DefaultParameterValue (1)] int u)
8         {
9                 return u;
10         }
11
12         public static T TestB<T> (T a, [Optional] T u)
13         {
14                 return u;
15         }
16         
17         public static object TestC ([Optional] object a)
18         {
19                 return a;
20         }
21
22         public static int Main ()
23         {
24                 if (TestA () != 1)
25                         return 1;
26
27                 if (TestB (-4) != 0)
28                         return 2;
29
30                 if (TestB ((object) null) != Missing.Value)
31                         return 3;
32
33                 if (TestC () != Missing.Value)
34                         return 4;
35                 
36                 return 0;
37         }
38 }