← Back to index
|
Original Bugzilla link
Bug 13056 – [2.066.0-b1] Regression: Error: template std.path.baseName cannot deduce function from argument types !()(DirEntry)
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-06T15:46:00Z
Last change time
2014-08-21T18:22:00Z
Assigned to
nobody
Creator
edwards.ac
Comments
Comment #0
by edwards.ac — 2014-07-06T15:46:25Z
The following compiles on DMD 2.065.0 but not in 2.066.0-b1: regress.d: ````d import std.file; import std.path; import std.string; import std.stdio; void main() { foreach(de; dirEntries(".", SpanMode.depth)) { writeln(de.baseName); } } ```` Output: regress.d(10): Error: template std.path.baseName cannot deduce function from argument types !()(DirEntry), candidates are: /usr/share/dmd/src/phobos/std/path.d(287): std.path.baseName(R)(R path) if (isRandomAccessRange!R && hasSlicing!R && isSomeChar!(ElementType!R) || isSomeString!R) /usr/share/dmd/src/phobos/std/path.d(311): std.path.baseName(CaseSensitive cs = CaseSensitive.osDefault, C, C1)(inout(C)[] path, in C1[] suffix) if (isSomeChar!C && isSomeChar!C1)
Comment #1
by bugzilla — 2014-07-06T21:33:28Z
A reduced test case: import std.range; struct DirEntry { alias name this; @property string name(); } void main() { static assert(isRandomAccessRange!DirEntry); }
Comment #2
by bugzilla — 2014-07-06T22:28:11Z
This boils down to, once again, front() returning a different type than the indexed type for narrow strings. Arggh.
Comment #3
by bugzilla — 2014-07-06T23:18:01Z
https://github.com/D-Programming-Language/phobos/pull/2306
Comment #4
by github-bugzilla — 2014-07-07T03:02:02Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/daa82fdce83368731448d50e50cfa6be3aaeb2dc
fix Issue 13056 - [2.066.0-b1] Regression: Error: template std.path.baseName cannot deduce function from argument types !()(DirEntry)
https://github.com/D-Programming-Language/phobos/commit/592eb10d3fcf2150fddc06cb2320b41fec5ed9fa
Merge pull request #2306 from WalterBright/fix13056 fix Issue 13056 - [2.066.0-b1] Regression: Error: template std.path.base...
Comment #5
by github-bugzilla — 2014-07-08T01:15:09Z
Commit pushed to 2.066 at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/39979978bf352f23bf5e020d5140b5770dc2d2bf
Merge pull request #2306 from WalterBright/fix13056 fix Issue 13056 - [2.066.0-b1] Regression: Error: template std.path.base...
Comment #6
by code — 2014-07-11T16:02:44Z
*** Issue 13098 has been marked as a duplicate of this issue. ***
Comment #7
by github-bugzilla — 2014-08-21T18:22:00Z
Commit pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/39979978bf352f23bf5e020d5140b5770dc2d2bf
Merge pull request #2306 from WalterBright/fix13056