On Tuesday, 18 December 2018 at 22:56:19 UTC, H. S. Teoh wrote:
Since no explicit slicing was done, there was no compiler error
/ warning of any sort, and it wasn't obvious from the code what
had happened. By the time doSomething() was called, it was
already long past the source of the problem in buggyCode(), and
it was almost impossible to trace the problem back to its
source.
Theoretically, -dip25 and -dip1000 are supposed to prevent this
sort of problem, but I don't know how fully-implemented they
are, whether they would catch the specific instance in your
code, or whether your code even compiles with these options.
T
No luck. Actually, I avoid in my code pointers in general, I
write my code very "Java-like" with objects everywhere etc. I
gave up on the issue actually, perhaps I am encountering this bug
https://issues.dlang.org/show_bug.cgi?id=16511 in my own code.
Anyway, 32-bit and 64-bit debug work, so does LDC. That's good
enough for me.