[arm64] Add the full neon regs to the context
[mono.git] / mcs / tests / dtest-null-operator-01.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4  
5 class X
6 {
7         public string Prop;
8         public A A = new A ();
9 }
10
11 class A
12 {
13         public string B;
14 }
15
16 class MainClass
17 {
18         static void NullCheckTest ()
19         {
20                 dynamic dyn = null;
21                 dynamic res;
22
23                 res = dyn?.ToString ();
24                 res = dyn?.GetHashCode ();
25                 res = dyn?.DD.Length?.GetHashCode ();
26
27                 dyn?.ToString ();
28
29                 res = dyn?.Prop;
30                 res = dyn?.Prop?.Prop2;
31                 res = dyn?[0];
32         }
33
34         static void Test_1 ()
35         {
36                 dynamic dyn = new X ();
37                 dynamic res;
38
39                 res = dyn.Prop?.Length;
40                 res = dyn.A.B?.C.D?.E.F;
41         }
42
43         static dynamic Test_2 (IEnumerable<dynamic> collection)
44         {
45                 return collection?.FirstOrDefault ().Length;
46         }       
47
48         public static void Main ()
49         {
50                 NullCheckTest ();
51
52                 Test_1 ();
53                 Test_2 (null);
54         }
55 }
56
57