@@ -902,7 +902,7 @@ unittest
902
902
903
903
// / Prints structs and unions
904
904
pragma (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)
906
906
if (isSomeChar! C && is (T == struct ) || is (T == union ) && ! is (T : NumericSpec))
907
907
{
908
908
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)
945
945
static if (is (typeof (w.put((* cast (T* )&c).toString))))
946
946
w.put((* cast (T* )&c).toString);
947
947
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.");
949
950
}
950
951
951
952
return w;
@@ -994,7 +995,7 @@ ref W print(C = char, W, T)(scope return ref W w, ref const T c)
994
995
// / ditto
995
996
// FUTURE: remove it
996
997
pragma (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)
998
999
if (isSomeChar! C && is (T == struct ) || is (T == union ))
999
1000
{
1000
1001
return print! (C, W, T)(w, c);
0 commit comments