[w32file] Move MonoIO.Find{First,Next,Close} to managed
[mono.git] / mcs / tests / gtest-iter-15.cs
1 using System;
2 using System.Collections.Generic;
3
4 internal class C<TFirst>
5 {
6         internal struct VSlot<T>
7         {
8                 public readonly T Value;
9
10                 public VSlot (T value)
11                 {
12                         Value = value;
13                 }
14         }
15
16         internal IEnumerable<V> GetEnumerable<V> (IEnumerable<VSlot<V>> input)
17         {
18                 foreach (var v in input)
19                         yield return v.Value;
20         }
21 }
22
23 class C
24 {
25         public static int Main ()
26         {
27                 var c = new C<long> ();
28                 string value = null;
29                 foreach (var v in c.GetEnumerable (new[] { new C<long>.VSlot<string> ("foo") })) {
30                         value = v;
31                 }
32
33                 if (value != "foo")
34                         return 1;
35
36                 return 0;
37         }
38 }