January 28, 2019
https://issues.dlang.org/show_bug.cgi?id=19626

          Issue ID: 19626
           Summary: RedBlackTree of an enum fails in unittest mode
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody@puremagic.com
          Reporter: porton@narod.ru

Ubuntu Linux 18.10

$ dmd --version
DMD64 D Compiler v2.080.1

The following code does not compile in unittest mode:

---
import std.container.rbtree;
import std.stdio;

enum T { a, b }

alias t = RedBlackTree!T;

void main() { }
---

$ dmd -unittest app.d
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(817): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(991): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1056): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1084): Error: none of
the overloads of `this` are callable using argument types `(int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1085): Error: none of
the overloads of `this` are callable using argument types `(int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1086): Error: none of
the overloads of `this` are callable using argument types `(int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1087): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1111): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1173): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int, int, int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1190): Error: cannot
implicitly convert expression `[7, 8, 6, 9, 10, 8]` of type `int[]` to `T[]`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1222): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1227): Error: cannot
implicitly convert expression `1` of type `int` to `T`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1227): Error: cannot
implicitly convert expression `6` of type `int` to `T`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1266): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1308): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1355): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1447): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int, int, int, int, int, int, int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1601): Error: none of
the overloads of `this` are callable using argument types `(int, int, int, int,
int)`, candidates are:
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1727):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this(T[]
elems...)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1743):
`std.container.rbtree.RedBlackTree!(T, "a < b", false).RedBlackTree.this()`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1748):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.this(RBNode!(T)* end, ulong length)`
/snap/dmd/40/bin/../import/phobos/std/container/rbtree.d(1736):
`std.container.rbtree.RedBlackTree!(T, "a < b",
false).RedBlackTree.__ctor(Stuff)(Stuff stuff) if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem))`
app.d(6): Error: template instance `std.container.rbtree.RedBlackTree!(T, "a <
b", false)` error instantiating

--