https://issues.dlang.org/show_bug.cgi?id=15083
--- Comment #2 from John Colvin <john.loughran.col...@gmail.com> --- (In reply to Marc Schütz from comment #1) > (In reply to John Colvin from comment #0) > > This uses phobos, but I'm pretty sure typeof should work here so it's a dmd > > bug. > > typeof itself _does_ work, this compiles fine: > > pragma(msg, typeof(dirEntries(path, filetype, SpanMode.depth))); > // prints: FilterResult!(f, DirIterator) good point > But FilteResult is evidently a Voldemort type, and you can't declare a > variable of this type. So I believe this is not a bug. You can definitely declare variables with Voldemort types. e.g. auto foo(){ struct S{} return S(); } void bar(){ typeof(foo()) a; } is fine. The problem here is to do with the initialiser. typeof(dirEntries(path, filetype, SpanMode.depth)) files = void; doesn't cause any problems. --