[Issue 22094] New: Static members are not accessible via 'alias this' inside the subtype

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 30 06:30:29 UTC 2021


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 at puremagic.com
          Reporter: maxsamukha at 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`

--


More information about the Digitalmars-d-bugs mailing list