[Issue 14890] New: [REG 2.068.0-rc1] Can not construct a RedBlackTree of Tuples
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Aug 9 09:15:09 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14890
Issue ID: 14890
Summary: [REG 2.068.0-rc1] Can not construct a RedBlackTree of
Tuples
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: gassa at mail.ru
Code:
-----
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
typecons.d(658).
I can build a redBlackTree !(int), or compare two of my Tuples, just fine. It
is their combination that does not work.
--
More information about the Digitalmars-d-bugs
mailing list