@@ -443,7 +443,7 @@ OBJ_MEMBER_SWITCH:
443443 JSONValue! SType newItem;
444444 tokenizer.deserializeImpl(newItem, relPol);
445445 __traits (getMember , item, extrasMember).object[name.to! (immutable (SType))] = newItem;
446- break ;
446+ break OBJ_MEMBER_SWITCH ;
447447 }}
448448 else
449449 {
@@ -851,6 +851,13 @@ void serializeImpl(T, Char)(scope void delegate(const(Char)[]) w, ref T val) if
851851 serializeImpl(w, val[]);
852852}
853853
854+ unittest
855+ {
856+ // ensure static array serialization works
857+ int [5 ] arr = [1 ,2 ,3 ,4 ,5 ];
858+ assert (serialize(arr) == " [1, 2, 3, 4, 5]" );
859+ }
860+
854861void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, ref T val) if (is (T == enum ))
855862{
856863 // enums are special, serialize based on the name. Unless there's a UDA
@@ -867,7 +874,7 @@ void serializeImpl(T, Char)(scope void delegate(const(Char)[]) w, ref T val) if
867874 }
868875}
869876
870- void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, ref T val) if (isDynamicArray! T && ! isSomeString! T && ! is (T == enum ))
877+ void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, T val) if (isDynamicArray! T && ! isSomeString! T && ! is (T == enum ))
871878{
872879 // open brace
873880 w(" [" );
@@ -883,7 +890,7 @@ void serializeImpl(T, Char)(scope void delegate(const(Char)[]) w, ref T val) if
883890 w(" ]" );
884891}
885892
886- void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, ref T val) if (is (T == V[K], V, K) /* && isSomeString!K */ )
893+ void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, T val) if (is (T == V[K], V, K) /* && isSomeString!K */ )
887894{
888895 assert (is (T == V[K], V, K));
889896 enum useKW = ! isSomeString! K;
@@ -949,7 +956,7 @@ unittest
949956 assert (serialized == ` {"a" : 1, "b" : 2}` || serialized == ` {"b" : 2, "a" : 1}` );
950957}
951958
952- void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, ref T val) if (isSomeString! T)
959+ void serializeImpl (T, Char)(scope void delegate (const (Char)[]) w, T val) if (isSomeString! T)
953960{
954961 w(` "` );
955962 put(w, val);
0 commit comments