Merge remote-tracking branch 'origin/master' into init_auto
[nit.git] / lib / serialization / serialization.nit
index 5558d66..8ae8d2f 100644 (file)
@@ -46,6 +46,7 @@ module serialization is
        new_annotation auto_serializable
        new_annotation serialize
        new_annotation noserialize
+       new_annotation serialize_as
 end
 
 # Abstract serialization service to be sub-classed by specialized services.
@@ -107,6 +108,7 @@ abstract class Deserializer
        # All refinement should look for a precise `class_name` and call super
        # on unsupported classes.
        protected fun deserialize_class(class_name: String): nullable Object do
+               if class_name == "Error" then return new Error.from_deserializer(self)
                return deserialize_class_intern(class_name)
        end
 
@@ -220,7 +222,7 @@ redef class Char super DirectSerializable end
 redef class Int super DirectSerializable end
 redef class Float super DirectSerializable end
 redef class NativeString super DirectSerializable end
-redef class String super DirectSerializable end
+redef class Text super DirectSerializable end
 redef class SimpleCollection[E] super Serializable end
 redef class Map[K, V] super Serializable end