From 4b01d41d05f4975449d15c43b82d9ac5da1323a9 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:59:56 -0700 Subject: [PATCH] more errors --- errors/src/errors/ast/ast_errors.rs | 7 +++++++ .../src/errors/type_checker/type_checker_error.rs | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/errors/src/errors/ast/ast_errors.rs b/errors/src/errors/ast/ast_errors.rs index ef056ac032..63f8ce2d2f 100644 --- a/errors/src/errors/ast/ast_errors.rs +++ b/errors/src/errors/ast/ast_errors.rs @@ -145,4 +145,11 @@ create_messages!( msg: format!("failed to convert symbol_table to a json value {error}"), help: None, } + + @backtraced + variable_not_found { + args: (var: impl Display), + msg: format!("variable `{var}` not found in symbol table"), + help: None, + } ); diff --git a/errors/src/errors/type_checker/type_checker_error.rs b/errors/src/errors/type_checker/type_checker_error.rs index c8b932225c..9e141e942d 100644 --- a/errors/src/errors/type_checker/type_checker_error.rs +++ b/errors/src/errors/type_checker/type_checker_error.rs @@ -656,4 +656,19 @@ create_messages!( msg: format!("The loop bounds must be same type"), help: None, } + + @formatted + const_declaration_must_be_literal_or_tuple_of_literals { + args: (), + msg: format!("The value of a const declaration must be a literal"), + help: None, + } + + @formatted + loop_bound_must_be_literal_or_const { + args: (), + msg: format!("The loop bound must be a literal or a const"), + help: None, + } + );