mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-08 14:03:14 +00:00
Add error block around error_line calls
This commit is contained in:
@@ -89,6 +89,7 @@ gb_internal void check_or_else_split_types(CheckerContext *c, Operand *x, String
|
||||
|
||||
|
||||
gb_internal void check_or_else_expr_no_value_error(CheckerContext *c, String const &name, Operand const &x, Type *type_hint) {
|
||||
ERROR_BLOCK();
|
||||
gbString t = type_to_string(x.type);
|
||||
error(x.expr, "'%.*s' does not return a value, value is of type %s", LIT(name), t);
|
||||
if (is_type_union(type_deref(x.type))) {
|
||||
@@ -1565,6 +1566,7 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
|
||||
}
|
||||
|
||||
if (!operand->value.value_bool) {
|
||||
ERROR_BLOCK();
|
||||
gbString arg1 = expr_to_string(ce->args[0]);
|
||||
gbString arg2 = {};
|
||||
|
||||
@@ -1590,6 +1592,7 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
|
||||
operand->type = t_untyped_bool;
|
||||
operand->mode = Addressing_Constant;
|
||||
} else if (name == "panic") {
|
||||
ERROR_BLOCK();
|
||||
if (ce->args.count != 1) {
|
||||
error(call, "'#panic' expects 1 argument, got %td", ce->args.count);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user