Bug 12083 – std.path.absolutePath doesn't accept mutable strings

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-05T07:14:00Z
Last change time
2017-07-10T15:06:36Z
Keywords
pull
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2014-02-05T07:14:08Z
----- import std.path; void main() { char[] path = ".".dup; auto abs = path.absolutePath; } ----- $ dmd test.d > test.d(8): Error: function std.path.absolutePath (string path, lazy string base = getcwd()) is not callable using argument types (char[]) I think absolutePath should probably be typed as this or something similar: inout(char)[] absolutePath(inout(char)[] path, lazy inout(char)[] base = getcwd())
Comment #1 by hsteoh — 2014-09-19T22:18:20Z
Comment #2 by github-bugzilla — 2014-09-20T11:03:29Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/875f2fe0314931ef86e597a3d87069c1b914c5bb Merge pull request #2537 from quickfur/issue12083 std.path.absolutePath should accept mutable pathnames.
Comment #3 by hsteoh — 2014-10-30T22:33:45Z
Ultimately, this is caused by buildPath() always returning immutable, even though there's no reason it has to.