[Issue 9168] New: AA.length is impure and unsafe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 16 22:18:33 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9168

           Summary: AA.length is impure and unsafe
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: lt.infiltrator at gmail.com


--- Comment #0 from lt.infiltrator at gmail.com 2012-12-16 22:18:32 PST ---
This code fails to compile:
------------------------
void main() pure @safe {
    int[int] aa;
    aa.length == 0;
}
------------------------
/home/c213/c231.d(3): Error: pure function 'main' cannot call impure function
'length'
/home/c213/c231.d(3): 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: -------


More information about the Digitalmars-d-bugs mailing list