Bug 10916 – toHash on VariantN not being recognised
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-28T04:21:00Z
Last change time
2014-07-04T16:57:54Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
public2
Comments
Comment #0 by public2 — 2013-08-28T04:21:47Z
Discussed at http://forum.dlang.org/thread/[email protected].
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.