Bug 7239 – C style struct initialization doesn't work with aliases
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-06T05:40:00Z
Last change time
2015-06-09T05:11:48Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
hoganmeier
Comments
Comment #0 by hoganmeier — 2012-01-06T05:40:32Z
struct vec
{
float x,y,z,w;
alias x r; //! for color access
alias y g; //! ditto
alias z b; //! ditto
alias w a; //! ditto
}
void main()
{
vec a = {x: 0, g: 0, b: 0, a: 1};
}
test.d(13): Error: vec.g is not a per-instance initializable field
test.d(13): Error: g is not a field of vec
test.d(13): Error: vec.b is not a per-instance initializable field
test.d(13): Error: b is not a field of vec
test.d(13): Error: vec.a is not a per-instance initializable field
test.d(13): Error: a is not a field of vec