New tests.
[mono.git] / mcs / tests / gtest-iter-13.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 class C<T>
6 {
7         public IEnumerator GetEnumerator ()
8         {
9                 return new T[0].GetEnumerator ();
10         }
11
12         public IEnumerable<T> Filter (Func<T, bool> predicate)
13         {
14                 foreach (T item in this)
15                         if (predicate (item))
16                                 yield return item;
17         }
18 }
19
20 class M
21 {
22         public static void Main ()
23         {
24                 foreach (var v in new C<long>().Filter(null)) {
25                 }
26         }
27 }