[Issue 17108] New: Associative array byKeyValue is unsafe

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 19 06:07:09 PST 2017


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

          Issue ID: 17108
           Summary: Associative array byKeyValue is unsafe
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com

void main () @safe
{
    int[string] aa;
    foreach (val; aa.byKeyValue)
        ++aa[val.key];
}

/d399/f220.d(4): Error: @safe function 'D main' cannot call @system function
'object.byKeyValue!(int[string], string, int).byKeyValue'
/d399/f220.d(4): Error: @safe function 'D main' cannot call @system function
'object.byKeyValue!(int[string], string, int).byKeyValue.Result.empty'
/d399/f220.d(4): Error: @safe function 'D main' cannot call @system function
'object.byKeyValue!(int[string], string, int).byKeyValue.Result.popFront'
/d399/f220.d(5): Error: @safe function 'D main' cannot call @system function
'object.byKeyValue!(int[string], string, int).byKeyValue.Result.front.Pair.key'

--


More information about the Digitalmars-d-bugs mailing list