[Issue 15658] New: isFile isn't a template
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Feb 8 11:05:31 PST 2016
https://issues.dlang.org/show_bug.cgi?id=15658
Issue ID: 15658
Summary: isFile isn't a template
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: cpicard at openmailbox.org
I get a strange error when not using UFCS with isFile on a DirEntry with DMD
v0.270.0
To reproduce:
$ cat test.d
void main() {
import std.file, std.algorithm;
dirEntries("/tmp/", SpanMode.breadth).filter!(f => isFile(f));
}
$ dmd test.d
/usr/include/dlang/dmd/std/file.d(1743): Error: name.isFile isn't a
template
test.d(7): Error: template instance std.file.isFile!(DirEntry) error
instantiating
/usr/include/dlang/dmd/std/algorithm/iteration.d(985): instantiated
from here: __lambda2!(DirEntry)
/usr/include/dlang/dmd/std/algorithm/iteration.d(944): instantiated
from here: FilterResult!(__lambda2, DirIterator)
test.d(7): instantiated from here: filter!(DirIterator)
It is easy to circumvent though:
$ cat test2.d
void main() {
import std.file, std.algorithm;
dirEntries("/tmp/", SpanMode.breadth).filter!(f => f.isFile);
}
$ dmd test.d
<no output, ok>
--
More information about the Digitalmars-d-bugs
mailing list