[Issue 19626] RedBlackTree of an enum fails in unittest mode

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 16 10:46:19 UTC 2019


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

berni44 <bugzilla at d-ecke.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at d-ecke.de

--- Comment #2 from berni44 <bugzilla at d-ecke.de> ---
The bug can be found in

```
        static if (is(typeof(less) == string))
        {
            private enum doUnittest = isIntegral!T && (less == "a < b" || less
$
        }
        else
            enum doUnittest = false;

```

This is currently lines 750-755 in rbtree.d.

The check "isIntegral!T" is too weak. It's assumed, that this implies T
contains the numbers from 1 to 5. The check should test, whether T contains
these numbers.

--


More information about the Digitalmars-d-bugs mailing list