diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 13:29:55 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 13:29:55 -0400 |
| commit | bd190ac0a84eefa3174c04ce1fe2059aed6f2d1b (patch) | |
| tree | 09a21a50b60270ce26b2e78d51be20e2696280a4 /src/compile/tables.c | |
| parent | 24c6324898dd08007e3aa96abda3adf2941c90eb (diff) | |
Better error checking and reporting
Diffstat (limited to 'src/compile/tables.c')
| -rw-r--r-- | src/compile/tables.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compile/tables.c b/src/compile/tables.c index 958e5af5..54276c3b 100644 --- a/src/compile/tables.c +++ b/src/compile/tables.c @@ -25,7 +25,9 @@ Text_t compile_typed_table(env_t *env, ast_t *ast, type_t *table_type) { } type_t *key_t = Match(table_type, TableType)->key_type; + if (key_t == NULL) code_err(ast, "I couldn't figure out the key type for this table"); type_t *value_t = Match(table_type, TableType)->value_type; + if (value_t == NULL) code_err(ast, "I couldn't figure out the value type for this table"); if (value_t->tag == OptionalType) code_err(ast, "Tables whose values are optional (", type_to_text(value_t), ") are not currently supported."); |
