D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7138 - Can't call array() on dirEntries
Summary: Can't call array() on dirEntries
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 12:38 UTC by Andrej Mitrovic
Modified: 2012-04-13 09:50 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 Andrej Mitrovic 2011-12-19 12:38:05 UTC
module test;

import std.algorithm;
import std.array;
import std.file;

void main()
{
    auto dFiles = filter!`endsWith(a.name,".d")`(dirEntries(".",SpanMode.depth));
    auto arr1 = array(dFiles);  // OK

    auto arr2 = array(dirEntries(".",SpanMode.depth));  // NG??
}

test.d(11): Error: template std.array.array(Range) if (isIterable!(Range) && !isNarrowString!(Range)) does not match any function template declaration
test.d(11): Error: template std.array.array(Range) if (isIterable!(Range) && !isNarrowString!(Range)) cannot deduce template function from argument types !()(DirIterator)
Comment 1 Brad Anderson 2012-02-21 19:55:36 UTC
Still present in 2.058.
Comment 2 github-bugzilla 2012-03-17 10:20:13 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