[Issue 9555] New: Type deduction for new lambda syntax literals breaks with templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 21 03:06:38 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9555

           Summary: Type deduction for new lambda syntax literals breaks
                    with templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: m.strashun at gmail.com


--- Comment #0 from Dicebot <m.strashun at gmail.com> 2013-02-21 03:06:35 PST ---
Simple motivating example:

--- test.d ---
import std.functional;

void main()
{
    auto deleg = toDelegate(a => a > 2);
}
------

--- shell ---
$ rdmd test.d 
test.d(5): Error: template std.functional.toDelegate does not match any
function template declaration. Candidates are:
/usr/include/dmd/phobos/std/functional.d(722):       
std.functional.toDelegate(F)(auto ref F fp) if (isCallable!(F))
test.d(5): Error: template std.functional.toDelegate(F)(auto ref F fp) if
(isCallable!(F)) cannot deduce template function from argument types !()(void)
------

Type of lambda was deduced as "void" here.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list