dlr bug
[mcs.git] / tests / gtest-177.cs
blob7ff47a93bfacd0be06a91396f12273eb5ef9e0af
1 using System;
2 using System.Collections.Generic;
4 class X
6 static int[] x = new int[] {100, 200};
8 static int Main ()
10 IEnumerator<int> enumerator = X<int>.Y (x);
11 int sum = 0;
12 while (enumerator.MoveNext ())
13 sum += enumerator.Current;
15 if (sum != 300)
16 return 1;
18 if (X<int>.Z (x, 0) != 100)
19 return 2;
21 if (X<int>.Z (x, 1) != 200)
22 return 3;
24 return 0;
28 class X <T>
30 public static IEnumerator<T> Y (IEnumerable <T> x)
32 return x.GetEnumerator ();
35 public static T Z (IList<T> x, int index)
37 return x [index];