Merge pull request #1180 from akoeplinger/no-net40-in-make-check
[mono.git] / mcs / tests / test-null-operator-03.cs
1 using System;
2
3 class C
4 {
5     int field;
6
7     int Test1 ()
8     {
9         var x = this?.field;
10         if (x == null)
11             return 1;
12
13         // TODO: Should it really be of int? type
14
15         return 0;
16     }
17
18     static int Main ()
19     {
20         var c = new C ();
21         c.Test1 ();
22
23         const C c2 = null;
24         var res = c2?.field;
25         if (res != null)
26             return 1;
27
28         Console.WriteLine ("ok");
29         return 0;
30     }
31 }