www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 14] New: Unable to alias member variables


           Summary: Unable to alias member variables
           Product: D
           Version: 0.148
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: walter digitalmars.com
        ReportedBy: sean f4.ca

I think I'm merely running up against the limitations of 'alias' here. Can
'alias' be used to alias variables?  And if so, what are the restrictions?  The
spec isn't of much use here.  For reference, here is a shortened test case that
exhibits the problem.  Why can I alias 'i' but not 's.i'?  Is it merely a scope

C:\code\d\bugs>type 145_2.d
void main()
    struct S { int i; }
    S   s;
    int i;

    alias i   a1;
    alias s.i a2;
C:\code\d\bugs>dmd 145_2.d
145_2.d(8): s.i is used as a type


DStress test cases:


Mar 05 2006