using System.Collections;
struct X {
int [] a;
-
- public IEnumerator GetEnumerator ()
- {
+
+ public IEnumerator GetEnumerator ()
+ {
a = new int [3] { 1, 2, 3};
return a.GetEnumerator ();
- }
}
+}
class Y {
static X x;
- static int Main ()
+ public static int Main ()
{
int total = 0;
x = new X ();
total = 0;
+ foreach (object a in new X ()){
+ total += (int) a;
+ }
+ if (total != 6)
+ return 3;
+
+ total = 0;
+
//
// implicit block
//