Bug 20133 – [REG2.084.0] Bogus slice assignment in recursive CTFE call

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-08-15T21:46:54Z
Last change time
2021-11-08T20:45:36Z
Keywords
pull
Assigned to
No Owner
Creator
Sönke Ludwig

Comments

Comment #0 by sludwig — 2019-08-15T21:46:54Z
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.
Comment #1 by razvan.nitu1305 — 2019-08-19T15:06:29Z
Comment #2 by dlang-bot — 2021-10-27T08:03:14Z
@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
Comment #3 by dlang-bot — 2021-10-27T09:53:48Z
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
Comment #4 by dlang-bot — 2021-11-08T20:45:36Z
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