From 69ed23ee0035b6b49d160c194630288363404eef Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 28 Mar 2020 15:12:12 +0800 Subject: [PATCH] improve error messages --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9d418010..8caf3815 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,7 +112,7 @@ impl<'ctx> CodeGen<'ctx> { return Err(self.compile_error(CompileErrorKind::Unsupported("custom decorators"))) } } else { - return Err(self.compile_error(CompileErrorKind::Unsupported("complex decorators"))) + return Err(self.compile_error(CompileErrorKind::Unsupported("decorator must be an identifier"))) } } @@ -122,7 +122,7 @@ impl<'ctx> CodeGen<'ctx> { if let ast::ExpressionType::Identifier { name } = &annotation.node { Ok(self.get_basic_type(&name)?) } else { - Err(self.compile_error(CompileErrorKind::Unsupported("complex type annotation"))) + Err(self.compile_error(CompileErrorKind::Unsupported("type annotation must be an identifier"))) } } else { Err(self.compile_error(CompileErrorKind::MissingTypeAnnotation)) @@ -133,7 +133,7 @@ impl<'ctx> CodeGen<'ctx> { if let ast::ExpressionType::Identifier { name } = &returns.node { if name == "None" { None } else { Some(self.get_basic_type(name)?) } } else { - return Err(self.compile_error(CompileErrorKind::Unsupported("complex type annotation"))) + return Err(self.compile_error(CompileErrorKind::Unsupported("type annotation must be an identifier"))) } } else { None