rsdn/nemerle — Issue #146: [c# support] lambda expression return value should be dropped on demand
Author: zyhong
Created: 2011-10-23 05:25:53+00:00
State: open

public class DD
{
public DD(Action t)
{
}
//public DD(Func t)
//{
//}
}

public class Class2
{
void Test()
{
//var c1 = new DD(s => T1(s));
var c2 = new DD(s => T2(s));
}

void T1(string s)
{
}
string T2(string s)
{
return s;
}
}

this compiled fine in ms cs compiler but it generated this error:
D:\projects\logos\src\main\Logos\TestCSParser\C.cs(22,37): error : in argument #1 (t), needed a System.Action[string], got string+ -> string-: string+ -> string- is not a subtype of System.Action[string] [simple require]

any workaround (in c#, not nemerle) for this? Could not change T2 to return void.