http://d.puremagic.com/issues/show_bug.cgi?id=4274
--- Comment #2 from bearophile_hugs eml.cc 2010-06-05 04:50:08 PDT ---
Structs defined inside functions keep a hidden pointer field to the function
they are into. If you return the array of nonstatic structs, the scope stops
existing and this pointer points to garbage. To avoid this you need 'struct
closures', but I prefer to avoid them.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

http://d.puremagic.com/issues/show_bug.cgi?id=4274
--- Comment #3 from nfxjfg gmail.com 2010-06-05 05:04:20 PDT ---
So what? You _can_ have an array of closures.
Why not an array of nested structs?
The compiler should obviously allocate all variables referenced by the struct
on the heap, just like it is done with closures.
Otherwise, it's an half-implemented garbage feature that should be removed
before it causes any more harm.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------