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

2016-08-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

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

2016-08-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #22 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/d79299255878b71ed1115f0cacd93938ee02930e Fix issue 16394 -- document the intiializer

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 Ketmar Dark changed: What|Removed |Added CC|

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 Ali Cehreli changed: What|Removed |Added Keywords||industry

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #21 from Steven Schveighoffer --- (In reply to Eyal from comment #20) > It could be nice to add a setInit method that sets a given buffer to the > initial value, with no corner cases at all. Agreed. I was thinking

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #20 from Eyal --- It could be nice to add a setInit method that sets a given buffer to the initial value, with no corner cases at all. --

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #16 from Steven Schveighoffer --- (In reply to Eyal from comment #1) > Prints out: > [Int(1, 7FE7FED92000), Int(2, 7FE7FED92000)] > [Int(3, null), Int(0, 73)] > > The second field being printed for Int seems like

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #19 from Steven Schveighoffer --- (In reply to Eyal from comment #17) > Yeah, I've since figured it out - but was surprised because it is > inconsistent with code blocks like: x=>x+1 which is inferred to be a >

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #18 from Steven Schveighoffer --- druntime documentation PR: https://github.com/dlang/druntime/pull/1634 phobos initializeAll PR: https://github.com/dlang/phobos/pull/4736 --

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 Steven Schveighoffer changed: What|Removed |Added Keywords||pull, spec --

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #17 from Eyal --- > The other field being printed is the context pointer, since your struct is > nested in the unittest. Yeah, I've since figured it out - but was surprised because it is inconsistent with code blocks

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #15 from Steven Schveighoffer --- 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.

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #14 from ag0ae...@gmail.com --- (In reply to Steven Schveighoffer from comment #12) > 3) Changing the compiler potentially introduces new issues. Changing the > docs does not. (In reply to Steven Schveighoffer from comment #13) >

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #13 from Steven Schveighoffer --- changing the compiler when the existing code works JUST FINE as long as it's properly understood and documented seems like a horrible idea to me. It would be a different story if it

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #12 from Steven Schveighoffer --- 3) Changing the compiler potentially introduces new issues. Changing the docs does not. --

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #11 from ag0ae...@gmail.com --- Alright, these are arguments for changing the documentation instead of the implementation: 1) Changing the behavior would break existing code. 2) It's hard or impossible to fix in a satisfactory way. In

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

2016-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #10 from Steven Schveighoffer --- A compile time error isn't possible, as this is a virtual function. It would have to be a runtime error, which I think is even worse. Let's just fix the docs, any bugs that are in

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #9 from Eyal --- > Or functioning as designed, just not properly documented. > This part of TypeInfo is meant to be used internally. I don't think this > corner case warrants a compiler change, as the current state is

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #8 from Steven Schveighoffer --- (In reply to ag0aep6g from comment #7) > I.e., it's a long-standing bug. Or functioning as designed, just not properly documented. > Pretty much every bug fix can be considered a

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #7 from

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #6 from Steven Schveighoffer --- 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

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #5 from Eyal --- I disagree, a function which has subtle corner cases that cause cryptic bugs is never a "documentation issue". Maybe if it were called "unsafe_init_val" -- you'd know that documentation is crucial here.

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #4 from Steven Schveighoffer --- typeid(T).initializer is not meant to be used without understanding what it does in all cases. There are other subtle issues with it. I think this is just a documentation issue. I

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #3 from Eyal --- The workaround is pretty clear. But this is nasty! Anyone who uses typeid(T).init in a generic way (not caring what T is) is going to be broken. It would be better to have typeid(staticArr).init throw a

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 Steven Schveighoffer changed: What|Removed |Added CC|

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #2 from Steven Schveighoffer --- It has been this way since the beginning (traced it back to this commit: https://github.com/dlang/druntime/commit/1532910c769ab718a528c94c9157fecebd753c66) Looking at the code, there

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

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16394 --- Comment #1 from Eyal --- As a result, std.algorithm:initializeAll is also buggy: import std.stdio; unittest { struct Int { ~this() {} int x = 3; } import std.algorithm : initializeAll; Int[2] xs =