Merge pull request #4419 from BrzVlad/fix-oom-nre
[mono.git] / mcs / tests / gtest-493.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 namespace MonoGenericIteratorTest
6 {
7         public class MyType
8         {
9         }
10
11         public abstract class MyCollectionBase<T> : Dictionary<string, T>
12         {
13                 public new virtual IEnumerator GetEnumerator ()
14                 {
15                         return Values.GetEnumerator ();
16                 }
17         }
18
19         public class MyCollection : MyCollectionBase<MyType>
20         {
21         }
22
23         class MainClass
24         {
25                 public static void Main (string[] args)
26                 {
27                         MyCollection myCollection = new MyCollection ();
28
29                         foreach (MyType item in myCollection) {
30                                 Console.WriteLine ("Success.");
31                         }
32                 }
33         }
34 }