Bug 14 – Unable to alias member variables

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-03-05T13:05:00Z
Last change time
2014-02-14T20:33:32Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
sean

Comments

Comment #0 by sean — 2006-03-05T13:05:46Z
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
Comment #1 by bugzilla — 2006-06-20T01:56:47Z
Fixed documentation to explain error.