www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22094] New: Static members are not accessible via 'alias

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

          Issue ID: 22094
           Summary: Static members are not accessible via  'alias this'
                    inside the subtype
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxsamukha gmail.com

struct S {
static:

    void foo() {
    }
}

struct S2 {
static:

    alias s = S;
    alias s this;

    void bar() {
        foo; // fails, should pass
    }
}

void main() {
    S2.foo; // passes as expected
}

onlineapp.d(11): Error: undefined identifier `foo`

--
Jun 29