linux-packaging-mono/mcs/tests/test-anon-147.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

28 lines
472 B
C#

using System;
static class C
{
public static Func<T1, Func<T2, Action<T3>>> Curry<T1, T2, T3> (this Action<T1, T2, T3> self)
{
return value1 => value2 => value3 => self (value1, value2, value3);
}
}
class Test
{
public static int Main ()
{
Action<int, int, int> test = (x, y, z) => {
int i = x + y + z;
Console.WriteLine (i);
if (i != 19)
throw null;
};
Func<int, Func<int, Action<int>>> f = test.Curry ();
f (3) (5) (11);
return 0;
}
}