www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15892] New: Can't use alias this with struct static member


          Issue ID: 15892
           Summary: Can't use alias this with struct static member
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ntrel-pub mybtinternet.com

With dmd 2.070.2:

struct S
    struct Static
        int payload;
    alias Static.payload this; // no identifier for declarator Static.payload

    alias get this; // OK
    ref  property get(){return Static.payload;}

Same error if Static is moved outside of S.

(This pattern is useful for grouping members and methods of S that shouldn't
conflict with the symbol used with alias this).

Apr 07 2016