Merge pull request #1203 from esdrubal/protect
[mono.git] / mcs / tests / gtest-autoproperty-09.cs
1 using System;
2
3 struct S
4 {
5         public static int P { get; } = 4;
6
7         public static int[] PA { get; } = { 0, 2 };
8
9         public static int Main ()
10         {
11                 if (P != 4)
12                         return 1;
13
14                 if (PA [1] != 2)
15                         return 10;
16
17                 var c = new C ();
18                 if (c.P != -3)
19                         return 2;
20
21                 if (c.P2 != 1)
22                         return 3;
23
24                 c.P2 = 9;
25                 if (c.P2 != 9)
26                         return 4;
27
28                 var s = new S2 (null);
29                 if (s.P != 4)
30                         return 12;
31
32                 if (s.P2 != 1)
33                         return 13;
34
35                 s.P2 = 9;
36                 if (s.P2 != 9)
37                         return 14;
38
39                 return 0;
40         }
41 }
42
43 class C
44 {
45         public decimal P { get; } = -3;
46         public int P2 { get; set; } = 1;
47 }
48
49 struct S2
50 {
51         public int P { get; } = 4;
52         public int P2 { get; set; } = 1;
53
54         public S2 (object o)
55         {
56         }
57 }