2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / errors / cs1579-2.cs
1 // cs1579.cs: foreach statement cannot operate on variables of type 'Foo' because 'Foo' does not contain a public definition for 'GetEnumerator'
2 // Line: 12
3
4 using System;
5 using System.Collections;
6
7 public class Test
8 {
9         public static void Main ()
10         {
11                 Foo f = new Foo ();
12                 foreach (object o in f)
13                         Console.WriteLine (o);
14         }
15 }
16
17 public class Foo
18 {
19         internal IEnumerator GetEnumerator ()
20         {
21                 return new ArrayList ().GetEnumerator ();
22         }
23 }