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

          Issue ID: 17156
           Summary: Local function declaration not inferred to be static
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

void f() {
    uint function() a = () => 5; // OK

    static uint s() { return 5; }
    uint function() b = &s; // ALSO OK

    uint g() { return 5; }
    uint function() c = &g; // BOOM! "&g" is a delegate. why?
}


There should not really be a difference between "s" and "g". The "static" there
should be inferred from lack of any lexical capture.

--

Reply via email to