The following snippet yields "Error: array length mismatch assigning `[0..1]` to `[1..3]`", although no slice assignment should be going on: --- void bar(ref string text) { text = text[1 .. $]; string tcopy = text; if (tcopy.length > 0) bar(tcopy); } enum test = { string input = "foo"; bar(input); return input; } (); --- Works as expected up to DMD 2.083.1.
Introduced by: https://github.com/dlang/dmd/pull/9071
@BorisCarvajal created dlang/dmd pull request #13228 "Fix Issue 20133 - [REG2.084.0] Bogus slice assignment in recursive CTFE call" fixing this issue: - Fix Issue 20133 - [REG2.084.0] Bogus slice assignment in recursive CTFE call https://github.com/dlang/dmd/pull/13228
dlang/dmd pull request #13228 "Fix Issue 20133 - [REG2.084.0] Bogus slice assignment in recursive CTFE call" was merged into stable: - 72087baef11a71d2c6f6ea9bde9885a860cb658c by Boris Carvajal: Fix Issue 20133 - [REG2.084.0] Bogus slice assignment in recursive CTFE call https://github.com/dlang/dmd/pull/13228
dlang/dmd pull request #13279 "Merge `stable` into `master`" was merged into master: - 2d495c7c2073f7fb2234f81602dc9ec9af0c93b8 by Boris Carvajal: Fix Issue 20133 - [REG2.084.0] Bogus slice assignment in recursive CTFE call https://github.com/dlang/dmd/pull/13279