aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 00:28:38 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 00:28:38 -0400
commit0a54b8965319545741c427086d8994f77a72089f (patch)
tree955641fdb4d2f003113ba2a6266b72a53aa40672 /src
parent53f5178f711c7795b0bffca0a0b835333c7c8df5 (diff)
Better error message
Diffstat (limited to 'src')
-rw-r--r--src/compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compile.c b/src/compile.c
index 8658c057..20afec7a 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -2041,6 +2041,8 @@ CORD compile_typed_array(env_t *env, ast_t *ast, type_t *array_type)
{
env_t *scope = item_type->tag == EnumType ? with_enum_scope(env, item_type) : env;
+ if (is_incomplete_type(item_type))
+ code_err(ast, "This array's type can't be inferred!");
CORD code = CORD_all("TypedArrayN(", compile_type(item_type), CORD_asprintf(", %ld", n));
for (ast_list_t *item = array->items; item; item = item->next) {
code = CORD_all(code, ", ", compile_to_type(scope, item->ast, item_type));