https://issues.dlang.org/show_bug.cgi?id=16394
github-bugzi...@puremagic.com changed:
What|Removed |Added
Status|NEW |RESOLVED
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
https://issues.dlang.org/show_bug.cgi?id=16394
Ketmar Dark changed:
What|Removed |Added
CC|
https://issues.dlang.org/show_bug.cgi?id=16394
Ali Cehreli changed:
What|Removed |Added
Keywords||industry
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
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.
--
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
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
>
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
--
https://issues.dlang.org/show_bug.cgi?id=16394
Steven Schveighoffer changed:
What|Removed |Added
Keywords||pull, spec
--
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
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.
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)
>
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
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.
--
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
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
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
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
https://issues.dlang.org/show_bug.cgi?id=16394
ag0ae...@gmail.com changed:
What|Removed |Added
CC||ag0ae...@gmail.com
--- Comment #7 from
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
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.
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
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
https://issues.dlang.org/show_bug.cgi?id=16394
Steven Schveighoffer changed:
What|Removed |Added
CC|
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
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 =
27 matches
Mail list logo