--- import std.stdio; void main() { // for (auto bc = File.ByChunk(File(""), 1); ; ) { } // as expected // for (auto bc = File("").byChunk(1); false; ) { } // as expected for (auto bc = File("").byChunk(1); ; ) { } // infinite loop foreach(line; File("").byLine()) { } // infinite loop too } --- It writes this in infinite loop: Bypasses std.exception.ErrnoException@std\stdio.d(288) === Bypassed === std.exception.ErrnoException@std\stdio.d(288): Cannot open file `' in mode `rb' (No error) Not sure is it dmd or druntime issue.
Original testcase works fine now but I'd like to keep it opened as source issue is still unknown.
*** Issue 8455 has been marked as a duplicate of this issue. ***
Fixed by https://github.com/dlang/dmd/pull/1645.