[build] Fix warning (#4177)
[mono-project.git] / mcs / tests / gtest-optional-02.cs
blob890b05c4b53ba3e27a2b0e3864460a1109b94e6a
1 using System;
3 public class C
5 public static bool Test3 (int? i = new int ())
7 return i == 0;
10 public static bool Test2 (int? i = null)
12 return i == null;
15 public static int Test (int? i = 1)
17 return i ?? 9;
20 public static long Test4 (long? i = 5)
22 return i.Value;
25 public static int Main ()
27 if (Test () != 1)
28 return 1;
30 if (Test (null) != 9)
31 return 2;
33 if (!Test2 ())
34 return 3;
36 if (Test2 (3))
37 return 4;
39 if (!Test3 ())
40 return 5;
42 if (Test4 () != 5)
43 return 6;
45 return 0;