[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Dlang Bot  ---
dlang/dmd pull request #10422 "fix issue 16047: range error when assigning
nested aa with temporary" was merged into master:

- c3d94591422f5d9366639683c5a0c50f4c48aa64 by Mathis Beer:
  fix issue 16047: when extracting temporaries from an index expression for
assignment, mark the expression as assigning.
  This avoids the temporaries encountering a range error with nested
associative arrays.

https://github.com/dlang/dmd/pull/10422

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #4 from Dlang Bot  ---
@FeepingCreature updated dlang/dmd pull request #10422 "fix issue 16048: range
error when assigning nested aa with temporary" fixing this issue:

- fix issue 16047: when extracting temporaries from an index expression for
assignment, mark the expression as assigning.
  This avoids the temporaries encountering a range error with nested
associative arrays.

https://github.com/dlang/dmd/pull/10422

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

--- Comment #3 from FeepingCreature  ---
What happens here is that the complex expression for the first index forces DMD
to allocate a temporary. In the course of doing so, it forgets to indicate that
the temporary is for a nested assignment, and the temporary (which is a plain
IndexExp, not an assignment) runs into a range error.

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

FeepingCreature  changed:

   What|Removed |Added

 CC||default_357-l...@yahoo.de

--- Comment #2 from FeepingCreature  ---
Tighter repro:

struct Reassignable
{
void opAssign(Reassignable) {}
}

int s() { return 1; }

void main()
{
Reassignable[int][int] aa;

aa[0][0] = Reassignable.init;
aa[s()][0] = Reassignable.init; // range violation
}

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

--- Comment #1 from Mario Kroeplin  ---
Workaround: use `require`

aa.require(S("baz").s, null)["baz"] = SysTime.init;

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2016-12-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

MichaelZ  changed:

   What|Removed |Added

 CC||dlang@bregalad.de

--