[Bug 14] New: Unable to alias member variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 5 11:05:47 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=14

           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 at digitalmars.com
        ReportedBy: sean at 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
issue?

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

C:\code\d\bugs> 

DStress test cases:

http://dstress.kuehne.cn/run/a/alias_29_A.d
http://dstress.kuehne.cn/run/a/alias_29_B.d


-- 




More information about the Digitalmars-d-bugs mailing list