Incorrect warning with lambda function
Hi there,
I'm getting a context error from the R# 4.0 "pre-EAP" on a valid section of
code that involves lambda functions. The code in question is an
implementation of a Y-Combinator. The context error is:
"Argument type 'T' is not assignable to parameter type 'System.Func'"
The code generating the error is:
private class Wrap
{
public readonly Func, T> It;
public Wrap(Func, T> it) { It = it; }
}
public static Func Y(Func, Func> f)
{
Func>, Func> g = wx => f(wx.It(wx));
return g(new Wrap>(wx => f(y =>]]> wx.It(wx)(y))));
}
The context error appears for the segment "wx.It(wx)".
Thanks,
Mike Strobel
Please sign in to leave a comment.
Hello,
We appreciate your feedback. The corresponding JIRA request has been created,
and you are welcome to monitor its status at http://www.jetbrains.net/jira/browse/RSRP-58472.
You may want to check our request tracking policy here: http://www.jetbrains.net/confluence/display/ReSharper/ReSharperIssueTracker
Best regards,
- Development Team.