www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17885] New: Unable to remove a tuple from associative array.

https://issues.dlang.org/show_bug.cgi?id=17885

          Issue ID: 17885
           Summary: Unable to remove a tuple from associative array.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: keepitsimplesirius gmail.com

Unable to remove a tuple from an associative array. Repro:


unittest
{
    import std.stdio;
    import std.typecons;

    auto set = (void[0][Tuple!(size_t, size_t)]).init;

    set[tuple!(size_t, size_t)(1, 2)] = (void[0]).init;
    set[tuple!(size_t, size_t)(10, 3)] = (void[0]).init;
    set[tuple!(size_t, size_t)(43, 3)] = (void[0]).init;

    writeln(set);
    set.remove(tuple!(size_t, size_t)(10, 3));
    writeln(set);
    assert((tuple!(size_t, size_t)(10, 3) in set) is null);
}

int main() { return 0; }

DMD64 D Compiler v2.076.0-dirty
Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

--
Oct 08