Thread overview
[Issue 21035] wrong code when uses struct's methods of .init value
July 11
https://issues.dlang.org/show_bug.cgi?id=21035

Илья Ярошенко <ilyayaroshenko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--
July 14
https://issues.dlang.org/show_bug.cgi?id=21035

Stefan Koch <uplink.coder@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uplink.coder@gmail.com

--- Comment #1 from Stefan Koch <uplink.coder@gmail.com> ---
How does the wrong-ness of this code manifest?

--
July 14
https://issues.dlang.org/show_bug.cgi?id=21035

--- Comment #2 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
(In reply to Stefan Koch from comment #1)
> How does the wrong-ness of this code manifest?

It fails to execute with exit code -11

--
July 21
https://issues.dlang.org/show_bug.cgi?id=21035

--- Comment #3 from Stefan Koch <uplink.coder@gmail.com> ---
What happens is that a `memcpy` fails which seems to be done executing `data[0
.. str.length] = str`
why that happens is still under investigation

--
July 26
https://issues.dlang.org/show_bug.cgi?id=21035

KytoDragon <kytodragon@e.mail.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kytodragon@e.mail.de

--- Comment #4 from KytoDragon <kytodragon@e.mail.de> ---
Aren't the ".init" values read only? The append tries to change the "data" member of the initializer, which results in an memory write error.

--
July 31
https://issues.dlang.org/show_bug.cgi?id=21035

--- Comment #5 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
(In reply to KytoDragon from comment #4)
> Aren't the ".init" values read only? The append tries to change the "data" member of the initializer, which results in an memory write error.

D doesn't prohibit to call methods of right hand side values.

--
July 31
https://issues.dlang.org/show_bug.cgi?id=21035

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
                 CC|                            |pro.mathias.lang@gmail.com

--- Comment #6 from Mathias LANG <pro.mathias.lang@gmail.com> ---
Definitely an accepts-invalid.
Trying to bind `.init` to a mutable lvalue should not be allowed.

--