# Invalid dynamic type for a deserialized attribute
class AttributeTypeError
super AttributeError
autoinit receiver, attribute_name, attribute, expected_type
# Deserialized object that isn't of the `expected_type`
var attribute: nullable Object
# Name of the type expected for `attribute`
var expected_type: String
redef var message is lazy do
var attribute = attribute
var found_type = if attribute != null then attribute.class_name else "null"
return "Deserialization Error: {
}Wrong type on `{receiver.class_name}::{attribute_name}` expected `{expected_type}`, got `{found_type}`"
end
end
lib/serialization/serialization_core.nit:187,1--206,3