← Back to index
|
Original Bugzilla link
Bug 1402 – imbricated structs, functions and "with" generate invalid code
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2007-08-05T01:24:00Z
Last change time
2015-06-09T05:14:40Z
Keywords
wrong-code
Assigned to
dvdfrdmn
Creator
dlang-bugzilla
Comments
Comment #0
by dlang-bugzilla — 2007-08-05T01:24:23Z
alias ubyte[10] MyArray; struct MyInnerStruct { MyArray a; } struct MyStruct { MyInnerStruct i; } void test(MyArray a) { foreach(i,e;a) assert(i==e); } void main() { MyStruct s; foreach(i,ref e;s.i.a) e = i; // fill with [0,1,2,3,4,5,6,7,8,9] with(s.i) test(a); } Assert fails. Works without "with".
Comment #1
by dlang-bugzilla — 2007-08-05T01:26:02Z
oops, it was already reported. *** This bug has been marked as a duplicate of 1400 ***