[Issue 16394] TypeInfo.init() for static arrays returns single element instead of whole array
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Aug 16 07:30:15 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16394
--- Comment #15 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I just disagree that the current behavior is a bug. Note that this wasn't
documented to begin with, and whoever documented it (probably me) didn't
realize the corner case behavior. This was never a code bug IMO, it's working
as designed.
The runtime is full of undocumented implementation behaviors. Having worked
many times on fixing things, there's quite a few cases where the compiler and
runtime interact in weird undocumented ways. Documenting them is the first
step, then if we want to change it, then we change it with a proper discussion
with the main players.
I'm working on 2 PRs, one to fix the docs, and one to fix
std.algorithm.mutation.initializeAll (the only affected code in druntime or
Phobos).
Even if we get a dmd upgrade at some point, I'd like to at least fix the
current problems.
Interestingly enough, TypeInfo.initializer is rarely needed, because most of
the time, you have the static type, and that is usually plenty to get this
working.
--
More information about the Digitalmars-d-bugs
mailing list