www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19370] New: AA require() and update() can't be used in safe

https://issues.dlang.org/show_bug.cgi?id=19370

          Issue ID: 19370
           Summary: AA require() and update() can't be used in  safe code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: stanislav.blinov gmail.com

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.

--
Nov 06 2018