aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-08-01 11:39:04 +0100
committergingerBill <bill@gingerbill.org>2023-08-01 11:39:04 +0100
commit65206fe33e52a707134c919c01a0f8ae2d19c2d8 (patch)
tree2280e4e6c075e59eef0d86a269209641feeb843c /src/check_decl.cpp
parent2f094134a3e54cb6b99daf09b6a257b36f182b6e (diff)
Go through loads of `TODO`s
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 4a1a636f8..587d749b4 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -7,13 +7,15 @@ gb_internal Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *o
e->type == t_invalid) {
if (operand->mode == Addressing_Builtin) {
+ ERROR_BLOCK();
gbString expr_str = expr_to_string(operand->expr);
- // TODO(bill): is this a good enough error message?
error(operand->expr,
- "Cannot assign built-in procedure '%s' in %.*s",
- expr_str,
- LIT(context_name));
+ "Cannot assign built-in procedure '%s' in %.*s",
+ expr_str,
+ LIT(context_name));
+
+ error_line("\tBuilt-in procedures are implemented by the compiler and might not be actually instantiated procedure\n");
operand->mode = Addressing_Invalid;
@@ -159,9 +161,8 @@ gb_internal void check_init_constant(CheckerContext *ctx, Entity *e, Operand *op
}
if (operand->mode != Addressing_Constant) {
- // TODO(bill): better error
gbString str = expr_to_string(operand->expr);
- error(operand->expr, "'%s' is not a constant", str);
+ error(operand->expr, "'%s' is not a compile-time known constant", str);
gb_string_free(str);
if (e->type == nullptr) {
e->type = t_invalid;