www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10916] New: toHash on VariantN not being recognised

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

           Summary: toHash on VariantN not being recognised
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: public2 jasondendulk.com


--- Comment #0 from Jason den Dulk <public2 jasondendulk.com> 2013-08-28
04:21:47 PDT ---
Discussed at
http://forum.dlang.org/thread/bhbaxpxynjzpcfccdhkt forum.dlang.org.

Apparently the toHash function in VariantN is not declared properly, leading it
to ignored in favour of the default toHash for structs.

Currently:
  size_t toHash()
Should be:
  size_t toHash() const nothrow  safe


As an example of what happens - assert(Variant("a") in assoc) can fail even if
Variant("a") *is* a key of assoc.

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