Bug 15263 – [REG2.067.0] Cannot insert range into DList

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-10-30T01:25:00Z
Last change time
2015-11-07T02:32:16Z
Assigned to
nobody
Creator
ryan

Comments

Comment #0 by ryan — 2015-10-30T01:25:31Z
import std.range, std.container; unittest { auto r = iota(0,5); SList!int slist; DList!int dlist; slist.insert(r); // passes dlist.insert(r); // fails } You can insert a range into an SList, but not a DList. usr/include/dlang/dmd/std/container/dlist.d(683): Error: template std.container.dlist.DList!int.DList.createNode cannot deduce function from argument types !()(int), candidates are: /usr/include/dlang/dmd/std/container/dlist.d(166): std.container.dlist.DList!int.DList.createNode(Stuff)(ref Stuff arg, BaseNode* prev = null, BaseNode* next = null) /usr/include/dlang/dmd/std/container/dlist.d(688): Error: template std.container.dlist.DList!int.DList.createNode cannot deduce function from argument types !()(int, BaseNode*), candidates are: /usr/include/dlang/dmd/std/container/dlist.d(166): std.container.dlist.DList!int.DList.createNode(Stuff)(ref Stuff arg, BaseNode* prev = null, BaseNode* next = null) /usr/include/dlang/dmd/std/container/dlist.d(653): Error: template instance std.container.dlist.DList!int.DList.createRange!(Result) error instantiating /usr/include/dlang/dmd/std/container/dlist.d(414): instantiated from here: insertBeforeNode!(Result) phobos_dlist_bug.d(9): instantiated from here: insertBack!(Result) Failed: ["dmd", "-Isrc", "-main", "-unittest", "-debug", "-g", "-v", "-o-", "phobos_dlist_bug.d", "-I."]
Comment #1 by dlang-bugzilla — 2015-10-30T11:21:18Z
Comment #2 by yshuiv7 — 2015-11-06T01:02:02Z
Looks like we just need to make DList.createNode an auto ref function?
Comment #3 by ryan — 2015-11-07T02:32:16Z
(In reply to Yuxuan Shui from comment #2) > Looks like we just need to make DList.createNode an auto ref function? Correct, and this was actually fixed by https://github.com/D-Programming-Language/phobos/pull/3787#issuecomment-152760223. I'll go ahead and close.