[Issue 3531] New: 'curry' doesn't work for templated functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 20 03:58:01 PST 2009


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

           Summary: 'curry' doesn't work for templated functions
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: samukha at voliacable.com


--- Comment #0 from Max Samukha <samukha at voliacable.com> 2009-11-20 03:56:04 PST ---
auto add(A, B)(A x, B y)
{
    return x + y;
}

void main()
{
    alias curry!(add, 5) add5;
    assert(add5(6) == 11);
}

test.d(57): Error: template std.functional.curry!(add,5).curry(T) if
(is(typeof(fun(arg,T.init)))) does not match any fu
nction template declaration
test.d(57): Error: template std.functional.curry!(add,5).curry(T) if
(is(typeof(fun(arg,T.init)))) cannot deduce templat
e function from argument types !()(int)

The problem is with the constraint for curry(T)(T arg2). Remove the constraint
to workaround.

-- 
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