http://d.puremagic.com/issues/show_bug.cgi?id=9555
Maxim Fomin <maxim@maxim-fomin.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |maxim@maxim-fomin.ru
Resolution| |INVALID
--- Comment #1 from Maxim Fomin <maxim@maxim-fomin.ru> 2013-02-21 04:29:03 PST ---
Actually type of lambda was not deduced to void, void here is pseudo type of non-instantiated template, because a => a > 2 is a lambda template. If you append type of a parameter, this would work, for ex:
import std.functional;
void main()
{
auto deleg = toDelegate( (int a) => a > 2);
}
Since there is no guesses what type of "a" can be in the original code, template cannot be instantiated.
By the way, idea mentioned in forum discussion that there is problem with new (lambda) syntax is also wrong, because the code can be rewritten with delegate template:
import std.functional;
void main()
{
auto deleg = toDelegate( delegate (a) { return a > 2; } );
}
with the same problem and same error message.
Close this as invalid.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------