www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14890] New: [REG 2.068.0-rc1] Can not construct a


          Issue ID: 14890
           Summary: [REG 2.068.0-rc1] Can not construct a RedBlackTree of
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: gassa mail.ru


void main () {
    import std.container, std.typecons;
    alias Vertex = Tuple !(int, q{t}, int, q{v});
    auto cur = redBlackTree !(Vertex) ();

Works in 2.067.1 but fails to compile with 2.068: beta 1, beta 2 and release
candidate 1.

The error is:
...\src\phobos\std\functional.d-mixin-213(213): Error: template
std.typecons.Tuple!(int, "t", int, "v").Tuple.opCmp cannot deduce function from
argument types !()(inout(Tuple!(int, "t", int, "v"))), candidates are:
...\src\phobos\std\typecons.d(644):        std.typecons.Tuple!(int, "t", int,
"v").Tuple.opCmp(R)(R rhs) if (areCompatibleTuples!(typeof(this), R, "<"))
...\src\phobos\std\typecons.d(658):        std.typecons.Tuple!(int, "t", int,
"v").Tuple.opCmp(R)(R rhs) if (areCompatibleTuples!(typeof(this), R, "<"))
...\src\phobos\std\container\rbtree.d(825): Error: template instance
std.functional.binaryFun!("a < b", "a", "b").binaryFun!(Tuple!(int, "t", int,
"v"), inout(Tuple!(int, "t", int, "v"))) error instantiating
...\src\phobos\std\container\rbtree.d(1729):        instantiated from here:
RedBlackTree!(Tuple!(int, "t", int, "v"), "a < b", false)
test_rbtree.d(4):        instantiated from here: redBlackTree!(Tuple!(int, "t",
int, "v"))

Note the two identical candidates for opCmp listed as typecons.d(644) and

I can build a redBlackTree !(int), or compare two of my Tuples, just fine.  It
is their combination that does not work.

Aug 09 2015