www.digitalmars.com         C & C++   DMDScript  

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


          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:

    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;

    set.remove(tuple!(size_t, size_t)(10, 3));
    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 2017