From: Alexis Laferrière Date: Thu, 4 Aug 2016 14:53:37 +0000 (-0400) Subject: frontend: use a prettier "Unknown type" when the type is not in the AST X-Git-Url: http://nitlanguage.org frontend: use a prettier "Unknown type" when the type is not in the AST Signed-off-by: Alexis Laferrière --- diff --git a/src/frontend/serialization_phase.nit b/src/frontend/serialization_phase.nit index 2f07196..bb5cb8d 100644 --- a/src/frontend/serialization_phase.nit +++ b/src/frontend/serialization_phase.nit @@ -237,11 +237,14 @@ do var n_type = attribute.n_type var type_name + var type_name_pretty if n_type == null then # Use a place holder, we will replace it with the inferred type after the model phases type_name = toolcontext.place_holder_type_name + type_name_pretty = "Unknown type" else type_name = n_type.type_name + type_name_pretty = type_name end var name = attribute.name @@ -254,7 +257,7 @@ do var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}") if not {{{name}}} isa {{{type_name}}} then # Check if it was a subjectent error - v.errors.add new AttributeTypeError(self, "{{{attribute.serialize_name}}}", {{{name}}}, "{{{type_name}}}") + v.errors.add new AttributeTypeError(self, "{{{attribute.serialize_name}}}", {{{name}}}, "{{{type_name_pretty}}}") # Clear subjacent error if v.keep_going == false then return