Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

27 lines
720 B
C#

using System;
using System.Collections;
class X {
delegate int A ();
static IEnumerator GetIt (int [] args)
{
foreach (int arg in args) {
Console.WriteLine ("OUT: {0}", arg);
A a = delegate {
Console.WriteLine ("arg: {0}", arg);
Console.WriteLine ("args: {0}", args);
return arg;
};
yield return a ();
}
}
public static int Main ()
{
IEnumerator enumerator = GetIt (new int [] { 4, 8, 9});
enumerator.MoveNext ();
return 0;
}
}