diff --git a/nac3core/src/toplevel/type_annotation.rs b/nac3core/src/toplevel/type_annotation.rs index 3c4a9948..3cbc85cc 100644 --- a/nac3core/src/toplevel/type_annotation.rs +++ b/nac3core/src/toplevel/type_annotation.rs @@ -93,12 +93,13 @@ pub fn parse_ast_to_type_annotation_kinds( Ok(TypeAnnotation::TypeVar(ty)) } else { Err(format!( - "not a type variable identifier at {}", + "`{}` is not a valid type annotation (at {})", + id, expr.location )) } } else { - Err(format!("name cannot be parsed as a type annotation at {}", expr.location)) + Err(format!("`{}` is not a valid type annotation (at {})", id, expr.location)) } }; @@ -244,11 +245,11 @@ pub fn parse_ast_to_type_annotation_kinds( if let ast::ExprKind::Name { id, .. } = &value.node { class_name_handle(id, slice, unifier, locked) } else { - Err(format!("unsupported expression type for class name at {}", value.location)) + Err(format!("unsupported expression type for class name (at {})", value.location)) } } - _ => Err(format!("unsupported expression for type annotation at {}", expr.location)), + _ => Err(format!("unsupported expression for type annotation (at {})", expr.location)), } }