linux-packaging-mono/mcs/tests/gtest-lambda-02.cs

28 lines
408 B
C#
Raw Normal View History

//
// Lambda expression test overload resolution with parameterless arguments
//
using System;
delegate string funcs (string s);
delegate int funci (int i);
class X {
static void Foo (funci fi)
{
int res = fi (10);
Console.WriteLine (res);
}
static void Foo (funcs fs)
{
string res = fs ("hello");
Console.WriteLine (res);
}
public static void Main ()
{
Foo (x => x + "dingus");
}
}