Add support for Windows x64 Full AOT + LLVM + Interpreter on CI. (#15276)
[mono-project.git] / mcs / tests / test-nameof-05.cs
blob4ad5cdf547e8c744dbad0e1b154e95d8ce16d2d0
1 // Compiler options: -warnaserror
3 using System;
5 public class Person
7 public Car MyCar { get; set; }
10 public class Car
12 public int Year { get; set; }
15 enum EE
20 public class MainClass
22 class Nested
26 public static Person MyPerson1 { get; } = new Person();
27 public static Person MyPerson2 = new Person();
28 public const Person MyPerson3 = null;
29 public static event Action Act = null;
30 public static dynamic BBB = null;
32 void ParameterTest (Person ParPerson)
34 Console.WriteLine (nameof (ParPerson.MyCar.Year));
37 public static int Main ()
39 string name;
41 name = nameof (MyPerson1.MyCar.Year);
42 if (name != "Year")
43 return 1;
45 name = nameof (MyPerson2.MyCar.Year);
46 if (name != "Year")
47 return 2;
49 name = nameof (MyPerson3.MyCar.Year);
50 if (name != "Year")
51 return 3;
53 name = nameof (Act.Method.MemberType);
54 if (name != "MemberType")
55 return 4;
57 name = nameof (BBB.A.B.C);
58 if (name != "C")
59 return 5;
61 name = nameof (EE.K.ToString);
62 if (name != "ToString")
63 return 6;
65 name = nameof (int.ToString);
66 if (name != "ToString")
67 return 7;
69 Person LocPerson = null;
70 name = nameof (LocPerson.MyCar.Year);
71 if (name != "Year")
72 return 8;
74 return 0;