www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20921] New: Cannot get frame pointer in templated static


          Issue ID: 20921
           Summary: Cannot get frame pointer in templated static member
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: simen.kjaras gmail.com

struct S {
    int i;

    void fun() {
        // Works fine
        outside!(() => i);
        // staticInside cannot access frame of function S.fun
        staticInside!(() => i);

    static void staticInside(alias fn)() {
void outside(alias fn)() {

Since static member functions should be equivalent to free functions, the above
clearly should compile, but as indicated by comments, it does not.

Jun 11 2020