[Issue 13060] New: @nogc reading an associative array
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 6 19:19:35 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13060
Issue ID: 13060
Summary: @nogc reading an associative array
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
void foo(int[int] aa) @nogc {
auto y = aa[0];
}
void main() {}
Gives with dmd 2.066beta1:
test.d(2,16): Error: indexing an associative array in @nogc function foo may
cause GC allocation
AA.rehash could cause memory allocations, but looking for a key in an
associative could be regarded as @nogc.
--
More information about the Digitalmars-d-bugs
mailing list