https://issues.dlang.org/show_bug.cgi?id=15293
--- Comment #5 from ag0ae...@gmail.com --- Reduced further: ---- static import std.file; import std.stdio: File, writeln; void main() { std.file.write("gen.txt", "a\n\naa"); auto file = File("gen.txt"); char[] buffer; char[] line; file.readln(buffer, '\n'); line = buffer; file.readln(line, '\n'); line = buffer; file.readln(line, '\n'); writeln(line.capacity); /* "0" */ writeln(line[0 .. 1].capacity); /* "255" -- nonsense */ } ---- This reminds me more and more of issue 13856. --