@@ -902,7 +902,7 @@ unittest
902902
903903// / Prints structs and unions
904904pragma (inline, false )
905- ref W print (C = char , W, T)(scope return ref W w, ref const T c)
905+ ref W print (C = char , W, T)(scope return ref W w, ref scope const T c)
906906 if (isSomeChar! C && is (T == struct ) || is (T == union ) && ! is (T : NumericSpec))
907907{
908908 static if (__traits(hasMember, T, " toString" ))
@@ -945,7 +945,8 @@ ref W print(C = char, W, T)(scope return ref W w, ref const T c)
945945 static if (is (typeof (w.put((* cast (T* )&c).toString))))
946946 w.put((* cast (T* )&c).toString);
947947 else
948- static assert (0 , T.stringof ~ " .toString definition is wrong: 'const' qualifier may be missing." );
948+ c.toString(w);
949+ // static assert(0, T.stringof ~ ".toString definition is wrong: 'const' qualifier may be missing.");
949950 }
950951
951952 return w;
@@ -994,7 +995,7 @@ ref W print(C = char, W, T)(scope return ref W w, ref const T c)
994995// / ditto
995996// FUTURE: remove it
996997pragma (inline, false )
997- ref W print (C = char , W, T)(scope return ref W w, const T c)
998+ ref W print (C = char , W, T)(scope return ref W w, scope const T c)
998999 if (isSomeChar! C && is (T == struct ) || is (T == union ))
9991000{
10001001 return print! (C, W, T)(w, c);
0 commit comments