diff --git a/std/format.d b/std/format.d index d8bd45c5e..6558392ba 100644 --- a/std/format.d +++ b/std/format.d @@ -1419,6 +1419,8 @@ if (isPointer!T && !isInputRange!T) /** Objects are formatted by calling $(D toString). + Interfaces are formatted by casting to $(D Object) and then calling + $(D toString). */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (!isSomeString!T && is(T == class) && !isInputRange!T) @@ -1429,14 +1431,11 @@ if (!isSomeString!T && is(T == class) && !isInputRange!T) else put(w, val.toString); } -/** - Interfaces are formatted by casting to $(D Object) and then calling - $(D toString). - */ +/// ditto void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == interface) && !isInputRange!T) { - return formatValue(w, cast(Object) val, f); + return formatValue(w, cast(Object)val, f); } unittest