Thread overview
[Issue 12198] Catch some wrong overlapping array operations at compile time
May 16, 2016
Lionello Lunesu
Dec 17, 2022
Iain Buclaw
Jul 05, 2023
Nick Treleaven
May 16, 2016
https://issues.dlang.org/show_bug.cgi?id=12198

Lionello Lunesu <lio+bugzilla@lunesu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lio+bugzilla@lunesu.com
           Assignee|nobody@puremagic.com        |lio+bugzilla@lunesu.com

--- Comment #1 from Lionello Lunesu <lio+bugzilla@lunesu.com> ---
I ran into this as well and also think the compiler should make a best effort to detect this at compile time, to minimize run-time surprises.

I'm pretty far along with a patch, but am running into corner cases. Will push soon to get some feedback.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=12198

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--
July 05, 2023
https://issues.dlang.org/show_bug.cgi?id=12198

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
With dmd v2.104.0, this is the only line that fails:

>    a[] = a[];

Even this works:

    a[] = b[] / a[];

So it's not just rewriting it as `op=`.

--