Bug 14890 – [REG 2.068.0-rc1] Can not construct a RedBlackTree of Tuples
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-09T16:15:00Z
Last change time
2017-07-19T17:43:42Z
Keywords
pull, rejects-valid
Assigned to
code
Creator
gassa
Comments
Comment #0 by gassa — 2015-08-09T16:15:09Z
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.