Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-anon-148.cs
1 public delegate TResult Func<TResult> ();
2
3 public delegate void GeneratorNext<T> (ref T current);
4
5 public class GeneratorEnumerable<T>
6 {
7         public GeneratorEnumerable (Func<GeneratorNext<T>> next) { }
8 }
9
10 public class GeneratorExpression { }
11
12 public class GeneratorInvoker
13 {
14         public GeneratorInvoker (GeneratorExpression generator) { }
15         public void Invoke<T> (ref T current) { }
16 }
17
18 public static class Interpreter
19 {
20         public static object InterpretGenerator<T> (GeneratorExpression generator)
21         {
22                 return new GeneratorEnumerable<T> (
23                         () => new GeneratorInvoker (generator).Invoke
24                 );
25         }
26
27         public static int Main ()
28         {
29                 InterpretGenerator<int> (new GeneratorExpression ());
30                 return 0;
31         }
32 }