diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 02:58:44 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 02:58:44 -0400 |
| commit | 8b94c2c7f198babe64a2636538913cf67165709c (patch) | |
| tree | 6c0735bd11b7f2354121fb58e5d2103808b83843 | |
| parent | d0078ab024dbc3f557c4c1a62c42070ee7b20551 (diff) | |
Fix array ++= item
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -508,7 +508,7 @@ CORD compile_statement(env_t *env, ast_t *ast) if (!promote(env, &rhs, rhs_t, lhs_t)) { if (update->rhs->tag == Int && lhs_t->tag == IntType) rhs = compile_int_to_type(env, update->rhs, lhs_t); - else + else if (!(lhs_t->tag == ArrayType && promote(env, &rhs, rhs_t, Match(lhs_t, ArrayType)->item_type))) code_err(ast, "I can't do operations between %T and %T", lhs_t, rhs_t); } |
