D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7264 - Can't iterate result from 4-arg dirEntries as string
Summary: Can't iterate result from 4-arg dirEntries as string
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 00:24 UTC by Mike Parker
Modified: 2012-03-17 10:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mike Parker 2012-01-10 00:24:33 UTC
This example given for the 3-arg version of dirEntries works as expected:

---
foreach (string name; dirEntries(".", "*.d", SpanMode.breadth))
{
    writeln(name);
}
---

But when modified to use the 4-arg version, like so:

---
import std.stdio, std.file;

void main()
{
    foreach (string name; dirEntries(".", "*.d", SpanMode.breadth))
    {
        writeln(name);
    }
}
---

It fails with this error:

fail.d(7): Error: cannot implicitly convert expression (__r13.front()) of type D
irEntry to string
Comment 1 Mike Parker 2012-01-10 00:26:25 UTC
Sorry for the copy-paste error. The first example should have been this:

---
foreach (string name; dirEntries(".", SpanMode.breadth))
{
    writeln(name);
}
---
Comment 2 github-bugzilla 2012-03-17 10:20:09 UTC
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/58f1b2bc512059bbd36c36324208ed062ffea8f9
Merge pull request #495 from blackwhale/issue-7138

dirEntries issues 7264 & 7138
Comment 3 Dmitry Olshansky 2012-03-17 10:29:44 UTC
https://github.com/D-Programming-Language/phobos/pull/495