[Issue 4523] New: .remove method for Associative Arrays returns void in all cases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 27 18:13:50 PDT 2010


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

           Summary: .remove method for Associative Arrays returns void in
                    all cases
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-07-27 18:13:49 PDT ---
Example code errors out due to the .remove method returning void. This method
should return boolean true if the key was in the associative array, or false
otherwise:

void main() {
   int[string] array = ["test":0, "test2":1];

   bool found = array.remove("test");
   bool notfound = array.remove("nothing");
}

Errors:
assoc_test.d(6): Error: expression array TOK44 "test" is void and has no value
assoc_test.d(7): Error: expression array TOK44 "nothing" is void and has no
value

-- 
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