Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-null-operator-13.cs
1 using System;
2
3 static class Crash
4 {
5         static X GetFoo ()
6         {
7                 return null;
8         }
9
10         static int Main ()
11         {
12                 int res = (GetFoo ()?.ToLower ()).ToUpper ();
13                 if (res != 0)
14                         return 1;
15
16                 return 0;
17         }
18 }
19
20 class X
21 {
22         public Y ToLower ()
23         {
24                 throw new ApplicationException ("should not be called");
25         }
26 }
27
28 class Y
29 {
30 }
31
32 static class SS
33 {
34         public static int ToUpper (this Y y)
35         {
36                 if (y != null)
37                         return 1;
38
39                 return 0;
40         }
41 }