This PR implements the serialization of the `Error` class manually, it is declared in `core` above the `serialization` module.
Also updates `nitserial` so that it does not attempt to instantiate abstract classes with factories.
@privat I have doubts about the use of `is_abstract` and `is_class`, is it appropriate?
Pull-Request: #1821
Reviewed-by: Jean Privat <jean@pryen.org>
v.serialize_attribute("item", first)
end
end
+
+redef class Error
+ super Serializable
+
+ redef init from_deserializer(v)
+ do
+ v.notify_of_creation self
+
+ var message = v.deserialize_attribute("message")
+ if not message isa String then message = ""
+ init message
+
+ var cause = v.deserialize_attribute("cause")
+ if cause isa nullable Error then self.cause = cause
+ end
+
+ redef fun core_serialize_to(v)
+ do
+ v.serialize_attribute("message", message)
+ v.serialize_attribute("cause", cause)
+ end
+end
if mtype isa MGenericType and
mtype.is_subtype(m, null, serializable_type) and
mtype.is_visible_from(mmodule) and
+ mtype.mclass.kind == concrete_kind and
not compiled_types.has(mtype) then
compiled_types.add mtype