3 /* Test that the runtime can represent value types that have array fields that
4 * recursively refer to the same value type */
22 struct P
<X
> where X
: struct {
28 private static S4
[][] foo
;
30 public static readonly S4 West
= new S4(-1, 0);
31 public static readonly S4 East
= new S4(1, 0);
32 public static readonly S4 North
= new S4(0, 1);
33 public static readonly S4 South
= new S4(0, -1);
34 public static readonly S4
[] Directions
= { North, South, East, West }
;
36 public readonly int x
;
37 public readonly int z
;
39 public S4(int x
, int z
)
45 public override string ToString()
47 return string.Format("[{0}, {1}]", x
, z
);
54 Console
.WriteLine (typeof (S1
).Name
);
55 Console
.WriteLine (typeof (S2
).Name
);
56 Console
.WriteLine (typeof (S3a
).Name
);
57 Console
.WriteLine (typeof (S3b
).Name
);
58 foreach (var s4
in S4
.Directions
) {
59 Console
.WriteLine (s4
);
61 Console
.WriteLine (typeof (P
<S1
>).Name
);
62 Console
.WriteLine (typeof (P
<int>).Name
);