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

           Summary: Associative arrays work with unoverriden
                    `toHash`/`opEquals`/`opCmp`
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Denis Shelomovskij <[email protected]> 2013-06-16 
14:01:33 MSD ---
Documentation states classes must override `toHash`/`opEquals`/`opCmp` to work
as associative array keys. But current implementation works anyway.

As people are lazy I suppose lots of such classes are already used as
associative array keys.

So once e.g. compacting GC will be implemented and `Object`'s `toHash` equality
will stop being class instance address equality current AA implementation will
start using `Object`'s `opCmp` which will throw thus breaking lots of code.

I'd suggest to either document such usage or check in AA implementation that
required functions are overriden.

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

Reply via email to