[mono-api-html] Add solution.
[mono.git] / mcs / tests / gtest-330.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 public class BaseCollection<T> : IEnumerable<T>
6 {
7         protected List<T> items = new List<T> ();
8
9         IEnumerator<T> IEnumerable<T>.GetEnumerator ()
10         {
11                 return items.GetEnumerator ();
12         }
13
14         IEnumerator IEnumerable.GetEnumerator ()
15         {
16                 return items.GetEnumerator ();
17         }
18 }
19  
20 public class BaseIntList<T> : BaseCollection<T>
21 {
22 }
23
24 public class IntList : BaseIntList<int>
25 {
26 }
27
28 class X
29 {
30         public static void Main ()
31         {
32                 IntList list = new IntList ();
33                 foreach (int i in list) {
34                         Console.WriteLine (i);
35                 }
36         }
37 }