September 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6702

           Summary: .length for Associative Array is not @safe
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: htvennik@gmail.com


--- Comment #0 from Harry Vennik <htvennik@gmail.com> 2011-09-20 11:24:09 PDT ---
The 'length' property of an associative array should be usable from @safe code, but isn't.


The following code doesn't compile:

--------------
module assoc;

import std.stdio;

string[int] a = [1: "foo", 2: "bar"];

@safe void main()
{
    writefln("%d items.", a.length);
}
--------------

The compiler output is:

assoc.d(9): Error: safe function 'main' cannot call system function 'length'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6702


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-09-20 12:54:04 PDT ---
*** This issue has been marked as a duplicate of issue 6357 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------