Summary: cannot use delegates as parameters to non-global
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2011-03-06 06:26:40 PST ---
This pretty severely impacts the usability of template alias parameters for
lambda functions.

class Foo {
    uint doStuff(alias fun)(uint a, uint b) { return fun(a, b); }

void main() {
    auto foo = new Foo;

    uint add(uint a, uint b) { return a + b; }

    foo.doStuff!add(1, 2);

test9.d(10): Error: template instance cannot use local 'add' as parameter to
non-global template doStuff(alias fun)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to