From fa7fce90e788649ec847e5a4976672057a3e9068 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 25 Apr 2016 11:00:12 -0400 Subject: [PATCH] lib: Fix serialization issue with string-oriented typing Signed-off-by: Lucas Bajolet --- lib/json/serialization.nit | 2 +- tests/sav/test_json_deserialization_plain.res | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/json/serialization.nit b/lib/json/serialization.nit index 4f9df3c..5da6289 100644 --- a/lib/json/serialization.nit +++ b/lib/json/serialization.nit @@ -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] diff --git a/tests/sav/test_json_deserialization_plain.res b/tests/sav/test_json_deserialization_plain.res index ef8399f..eb9da24 100644 --- a/tests/sav/test_json_deserialization_plain.res +++ b/tests/sav/test_json_deserialization_plain.res @@ -23,7 +23,7 @@ # Nit: > # 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: > # JSON: not valid json -- 1.7.9.5