https://issues.dlang.org/show_bug.cgi?id=20471
Simen Kjaeraas <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Summary|DMD Crash |TypeInfo_Array incorrectly | |initialized --- Comment #2 from Simen Kjaeraas <[email protected]> --- The leaf node in the stack trace is object.TypeInfo_Array.toString(), and looking at that code (https://github.com/dlang/druntime/blob/2cc13ead1e7e535ef8ebd1f600d4ffb508a93f98/src/object.d#L532): override string toString() const { return value.toString() ~ "[]"; } This will fail if value is null. Is it null though? unittest { auto a = typeid(""); import std.stdio; writeln(a.toString()); } > immutable(char)[] Doesn't look like it. unittest { auto a = typeid(""); assert(a.value !is null, "a.value is null!"); } > [unittest] a.value is null! Uhm... It seems something is special cased when handling TypeInfo, so that the code in toString() doesn't run at that point. For whatever reason, this short-circuiting doesn't happen inside DMD, and so it crashes. --
