Bug 13098 – std.path functions no longer works with DirEntry

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-11T15:55:00Z
Last change time
2014-08-21T18:22:07Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-07-11T15:55:49Z
This regression was introduced by templating baseName and enforcing isSomeString for the argument. Previously baseName took a const(char)[] argument which triggered the implicit conversion of DirEntry to string (via alias name this).
Comment #1 by code — 2014-07-11T16:00:59Z
Introduced by https://github.com/D-Programming-Language/phobos/pull/2169. The regression applies to all of the following std.path methods. baseName, extSeparatorPos, extension, isRooted, isAbsolute The fix is to simply add a const(char)[] function as overload, which also saves some template instantiation in user code.
Comment #2 by code — 2014-07-11T16:02:44Z
*** This issue has been marked as a duplicate of issue 13056 ***
Comment #3 by k.hara.pg — 2014-07-11T16:42:03Z
Comment #4 by github-bugzilla — 2014-07-11T17:41:49Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/3a114c45fb89377413ae0cf33bc8c047c8875799 fix Issue 13098 - std.path functions no longer works with DirEntry https://github.com/D-Programming-Language/phobos/commit/20d2e6cd4f386a0fba8599588ded68a99b0efa8b Merge pull request #2324 from MartinNowak/fix13098 [REG2.066a] Issue 13098 - std.path functions no longer works with DirEntry
Comment #5 by k.hara.pg — 2014-07-14T15:32:22Z
This code has worked with 2.065, but cannot compile with git-head. import std.path; void main() { static struct DirEntry { string s; alias s this; } assert(isValidFilename(DirEntry("file.ext"))); }
Comment #6 by k.hara.pg — 2014-07-14T15:41:42Z
(In reply to Kenji Hara from comment #5) > This code has worked with 2.065, but cannot compile with git-head. > > import std.path; > void main() > { > static struct DirEntry { string s; alias s this; } > assert(isValidFilename(DirEntry("file.ext"))); > } https://github.com/D-Programming-Language/phobos/pull/2333
Comment #7 by github-bugzilla — 2014-07-15T23:41:16Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/35f1c347be326f6ac19118fd2b30f4eef5d76264 Remained fix for issue 13098 - isValidFilename and alias this https://github.com/D-Programming-Language/phobos/commit/8e9a7fea1f5a98bef61b9e97c4b8e09d141082c5 Merge pull request #2333 from 9rnsr/fix13098 [REG2.066a] Remained fix for issue 13098 - isValidFilename and alias this
Comment #8 by github-bugzilla — 2014-07-16T01:26:24Z
Commits pushed to 2.066 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/ec44674a1f988b8028c479577b681c31964f3f77 Merge pull request #2324 from MartinNowak/fix13098 [REG2.066a] Issue 13098 - std.path functions no longer works with DirEntry https://github.com/D-Programming-Language/phobos/commit/24bdbfb9eb588b19c7e03e9b09c252609249a76b Merge pull request #2333 from 9rnsr/fix13098 [REG2.066a] Remained fix for issue 13098 - isValidFilename and alias this
Comment #9 by github-bugzilla — 2014-08-21T18:22:07Z