Bug 8051 – alias member not accessible

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-05T18:48:00Z
Last change time
2012-12-02T11:30:55Z
Assigned to
nobody
Creator
ellery-newcomer

Comments

Comment #0 by ellery-newcomer — 2012-05-05T18:48:23Z
but it should be. dmd 2.059. the code: struct s{ union A{ int i; } A a; alias a.i i; } template FIELD_OFFSET(T, string field){ enum FIELD_OFFSET = cast(size_t) mixin("&(cast(T*)null)." ~ field); } void main(){ pragma(msg, FIELD_OFFSET!(s,"i")); } the fireworks: test.d(9): Error: struct test.s 'i' is not a member test.d(9): Error: struct test.s member i is not accessible test.d(9): Error: this for i needs to be type A not type s test.d(12): Error: template instance test.FIELD_OFFSET!(s,"i") error instantiating cast(ulong)&(__error).i
Comment #1 by hoganmeier — 2012-05-14T06:55:42Z
Comment #2 by andrej.mitrovich — 2012-12-02T11:30:55Z
*** This issue has been marked as a duplicate of issue 6842 ***