[Issue 16394] TypeInfo.init() for static arrays returns single element instead of whole array

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 15 15:56:31 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16394

--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I mean it's a doc issue in that the documentation doesn't reflect what
initializer() actually does (and has always done). There isn't much to say
except that I don't think we can change the behavior at this point without
breaking things.

It's been this way since 2009, so most people don't use it or care about it, or
they would have hit this issue before. I realize we can't get your time back
looking for this issue, but I think at this point, the best thing to do is fix
the docs and fix any code that was done using this incorrect assumption.

(In reply to Eyal from comment #5) 

> The reason is that this kind of assignment always goes through a stack
> allocation. When x.init is a large value, it unnecessarily allocates a huge
> chunk of stack. Our stacks are of limited size (fibers). This explodes.

I think this is a legitimate improvement to suggest.

--


More information about the Digitalmars-d-bugs mailing list