[Issue 18588] New: alias this inside named mixin template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 10 16:59:36 UTC 2018


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

          Issue ID: 18588
           Summary: alias this inside named mixin template
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: simen.kjaras at gmail.com

struct S {
    mixin foo!() bar;
}

template foo() {
    int n;
    alias n this;
}

unittest {
    int n = S.init;
}

The alias this is inside a named member of S, and it is counterintuitive that
it affects S.

--


More information about the Digitalmars-d-bugs mailing list