[Issue 16093] New: Trivial case of passing a template function to another template function doesn't compile

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 29 05:54:07 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16093

          Issue ID: 16093
           Summary: Trivial case of passing a template function to another
                    template function doesn't compile
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

void bar(alias f)() {
    f();
}

void main() {
    void f()() {
    }
    bar!f();
}

Error: function test.main.f!().f is a nested function and cannot be accessed
from test.bar!(f).bar


Non-template nested functions are accepted:

void main() {
    void f() {
    }
    bar!f(); // ok
}

--


More information about the Digitalmars-d-bugs mailing list