Example: char[] Something(char[] blah) { char[] slice = blah[0 .. 1]; slice[0] = 'h'; return blah; } void main() { pragma(msg, Something("foo".dup)); writefln("%s", Something("foo".dup)); } When compiled, this displays "foo"; when run, "hoo". Notice that slicing the input array and then modifying the slice is supposed to modify the original array, but it doesn't in CTFE because Slice() in the frontend always creates a copy of the data.
*** Issue 3456 has been marked as a duplicate of this issue. ***
*** Issue 4057 has been marked as a duplicate of this issue. ***
Fixed. D1: https://github.com/D-Programming-Language/dmd/commit/ef2a0f1da10331c4de102ca3e029ea1c1c1a46bf D2: https://github.com/D-Programming-Language/dmd/commit/0219a5f0dcc88076759a4c472582954d0fb804b0
*** Issue 5907 has been marked as a duplicate of this issue. ***
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル