https://issues.dlang.org/show_bug.cgi?id=21228
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #6 from Walter Bright <[email protected]> --- (In reply to Joseph Rushton Wakeling from comment #4) > The problem is that phobos uses speculative compilation to detect if a struct > defines toString - which swallows the aforementioned error message. What writeln() could do is first speculatively check to see that the symbol toString exists, and if it's there then compile it for keeps, rather than speculatively checking to see if calling it compiles. That way it won't be silently swallowing the errors in compiling the toString call. Re-categorizing as a problem in the std.stdio implementation of writeln(). A way to see if a symbol exists is to do something like: __traits(compiles, alias xxx = toString); --
