www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18588] New: alias this inside named mixin template


          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 puremagic.com
          Reporter: simen.kjaras 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.

Mar 10 2018