https://issues.dlang.org/show_bug.cgi?id=12980
Jonathan M Davis <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |INVALID --- Comment #2 from Jonathan M Davis <[email protected]> --- This code is perfectly legal. It just isn't safe. And if @safe were properly implemented with regards to slicing static arrays, and you marked your code here with @safe, then the compiler would generate an error when the static array was sliced. Unfortunately however, slicing static arrays is currently a hole in @safe: https://issues.dlang.org/show_bug.cgi?id=8838 But regardless, there's no bug in the language in your example, just in your code. It's not marked with @safe, so it's @system, so even if bug# 8838 were fixed, your code would still compile, because @system code is not checked for memory safety, and it's perfectly possible to do unsafe things with memory in @system code. --
