https://issues.dlang.org/show_bug.cgi?id=21244
Issue ID: 21244 Summary: Error: expression `hasToString!(..., char)` of type `void` does not have a boolean value Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: dlang-bugzi...@thecybershadow.net Looks like a DMD problem with recursive templated types. Partial reduction: //////////////////////// test.d //////////////////////// import std.format; import std.stdio; struct M(_) { struct N { M* next; void print() { next.print(); } void toString(void delegate(const(char)[]) sink) { if (next) sink.formattedWrite("%s", *next); } } N* root; void print() { writeln(this); } void toString(void delegate(const(char)[]) sink) { if (root) sink.formattedWrite("%s", *root); } } M!int x; //////////////////////////////////////////////////////// Yields a wall of errors starting with: .../std/format.d(4420): Error: expression hasToString!(M!int, char) of type void does not have a boolean value --