lib: Fix serialization issue with string-oriented typing
authorLucas Bajolet <r4pass@hotmail.com>
Mon, 25 Apr 2016 15:00:12 +0000 (11:00 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 28 Apr 2016 15:27:38 +0000 (11:27 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/json/serialization.nit
tests/sav/test_json_deserialization_plain.res

index 4f9df3c..5da6289 100644 (file)
@@ -355,7 +355,7 @@ class JsonDeserializer
                                var array_type = types.first
 
                                var typed_array
-                               if array_type == "FlatString" then
+                               if array_type == "ASCIIFlatString" or array_type == "UnicodeFlatString" then
                                        if has_nullable then
                                                typed_array = new Array[nullable FlatString]
                                        else typed_array = new Array[FlatString]
index ef8399f..eb9da24 100644 (file)
@@ -23,7 +23,7 @@
 # Nit: <JsonObject i:123, s:hello, f:123.456, a:[one,two], o:<null>>
 
 # JSON: {"__class": "MyClass", "i": 123, "s": "hello", "f": 123.456, "a": ["one", "two"], "o": "Not the right type"}
-# Errors: 'Deserialization Error: Wrong type on `MyClass::o` expected `nullable MyClass`, got `FlatString`'
+# Errors: 'Deserialization Error: Wrong type on `MyClass::o` expected `nullable MyClass`, got `ASCIIFlatString`'
 # Nit: <MyClass i:123 s:hello f:123.456 a:[one, two] o:<null>>
 
 # JSON: not valid json