Bug 19370 – AA require() and update() can't be used in @safe code

Status
REOPENED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-06T19:27:25Z
Last change time
2024-12-07T13:38:46Z
Keywords
safe
Assigned to
No Owner
Creator
Stanislav Blinov
Moved to GitHub: dmd#17172 →

Comments

Comment #0 by stanislav.blinov — 2018-11-06T19:27:25Z
void main() @safe { int[string] aa; // cannot call @system function... aa.require("a", 0); aa.update("a", { return 0; }, (ref int x) { x++; return x; }); } But also see issue 2954, issue 12420. AA improvement should start with fixing those.
Comment #1 by github-bugzilla — 2018-11-23T17:39:09Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/0914668dc25f1da1fccc90b849f20ca85d5f3971 Fix Issue 19370 - AA require() and update() can't be used in @safe code https://github.com/dlang/druntime/commit/29ce0543cb62229f005b2bc8540416dbccd1130e Merge pull request #2363 from radcapricorn/fix19370 Fix Issue 19370 - AA require() and update() can't be used in @safe code merged-on-behalf-of: Jacob Carlborg <[email protected]>
Comment #2 by stanislav.blinov — 2018-11-24T16:52:09Z
Having slept on it, I realize now that my fix isn't entirely correct still. More checks are needed, since more methods are called on keys. Reopening pending improved fix.
Comment #3 by robert.schadek — 2024-12-07T13:38:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17172 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB