Bug 7264 – Can't iterate result from 4-arg dirEntries as string
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-01-10T00:24:00Z
Last change time
2012-03-17T10:29:44Z
Assigned to
nobody
Creator
aldacron
Comments
Comment #0 by aldacron — 2012-01-10T00:24:33Z
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 by aldacron — 2012-01-10T00:26:25Z
Sorry for the copy-paste error. The first example should have been this:
---
foreach (string name; dirEntries(".", SpanMode.breadth))
{
writeln(name);
}
---
Comment #2 by github-bugzilla — 2012-03-17T10:20:09Z