Bug 14300 – [2.067-rc1] DList casting to base type is broken

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2015-03-17T12:26:00Z
Last change time
2017-07-19T17:42:43Z
Keywords
pull
Assigned to
nobody
Creator
NCrashed

Comments

Comment #0 by NCrashed — 2015-03-17T12:26:10Z
Worked on 2.066, but new release candidate fails. Code: ``` import std.container.dlist; interface ITest {} class Test : ITest {} void main() { DList!ITest().insertBack(new Test()); } ``` Output: ``` /usr/include/dmd/phobos/std/container/dlist.d(642): Error: template std.container.dlist.DList!(ITest).DList.createNode cannot deduce function from argument types !()(Test, BaseNode*, BaseNode*), candidates are: /usr/include/dmd/phobos/std/container/dlist.d(166): std.container.dlist.DList!(ITest).DList.createNode()(ref T arg, BaseNode* prev = null, BaseNode* next = null) /usr/include/dmd/phobos/std/container/dlist.d(414): Error: template instance std.container.dlist.DList!(ITest).DList.insertBeforeNode!(Test) error instantiating source/app.d(9): instantiated from here: insertBack!(Test) ```
Comment #1 by dlang-bugzilla — 2015-03-18T12:33:58Z
Comment #2 by code — 2015-03-20T02:10:39Z
Comment #3 by github-bugzilla — 2015-03-20T06:36:01Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a4f1cb07d2d0a5efe8f1ad9684c50f89a6080d37 fix Issue 14300 - DList casting to base type is broken - All insert methods should take `auto ref T t` instead of `Stuff t`, because the latter is an unnecessary temporary if `Stuff` isn't `T`. - Small, copyable, register sized Ts should always be passed by-value instead of auto ref. https://github.com/D-Programming-Language/phobos/commit/602dff55a78029930a918b5f96d79f7697bfd65c Merge pull request #3082 from MartinNowak/fix14300 fix Issue 14300 - DList casting to base type is broken
Comment #4 by github-bugzilla — 2015-03-20T12:19:54Z
Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/cda6103f7a6b207d565aaad31e75abf049ab59ab Merge pull request #3082 from MartinNowak/fix14300 fix Issue 14300 - DList casting to base type is broken
Comment #5 by github-bugzilla — 2015-04-11T12:25:08Z
Comment #6 by github-bugzilla — 2017-07-19T17:42:43Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a4f1cb07d2d0a5efe8f1ad9684c50f89a6080d37 fix Issue 14300 - DList casting to base type is broken https://github.com/dlang/phobos/commit/602dff55a78029930a918b5f96d79f7697bfd65c Merge pull request #3082 from MartinNowak/fix14300 fix Issue 14300 - DList casting to base type is broken