www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16178] New: Can't alias a mixin

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

          Issue ID: 16178
           Summary: Can't alias a mixin
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: hbaelx hotmail.com

A brief sample:

alias foo = mixin(bar!T);

where var!T returns the name of a valid variable, and thus mixin' it provides
access to said variable.

The previous code won't compile:

Error: basic type expected, not mixin

There is a known workaround around this issue:

alias hack(alias a) = a;
alias foo = hack!(mixin(bar!T));

But clearly it shouldn't have to be done like this.

--
Jun 16 2016