summaryrefslogtreecommitdiff
path: root/mcs/tests/test-anon-148.cs
blob: ba860a6981b3aae903a30d77a2ef49d26f9a3dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public delegate TResult Func<TResult> ();

public delegate void GeneratorNext<T> (ref T current);

public class GeneratorEnumerable<T>
{
	public GeneratorEnumerable (Func<GeneratorNext<T>> next) { }
}

public class GeneratorExpression { }

public class GeneratorInvoker
{
	public GeneratorInvoker (GeneratorExpression generator) { }
	public void Invoke<T> (ref T current) { }
}

public static class Interpreter
{
	public static object InterpretGenerator<T> (GeneratorExpression generator)
	{
		return new GeneratorEnumerable<T> (
			() => new GeneratorInvoker (generator).Invoke
		);
	}

	public static int Main ()
	{
		InterpretGenerator<int> (new GeneratorExpression ());
		return 0;
	}
}