diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-30 13:43:24 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-30 13:43:24 -0400 |
| commit | 56a44684faa9f91f5d5a794c3413ddd7dca93ca1 (patch) | |
| tree | dbd7c585935aad7b64a73d048685363eaffc8006 /repl.c | |
| parent | f1d4f928e433293e5f7c19f1b1388337ed339b23 (diff) | |
More errors
Diffstat (limited to 'repl.c')
| -rw-r--r-- | repl.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -395,6 +395,8 @@ void eval(env_t *env, ast_t *ast, void *dest) CASE_OP(MULT, *) CASE_OP(DIVIDE, /) CASE_OP(PLUS, +) CASE_OP(MINUS, -) case BINOP_EQ: case BINOP_NE: case BINOP_LT: case BINOP_LE: case BINOP_GT: case BINOP_GE: { type_t *t_lhs = get_type(env, binop->lhs); + if (!type_eq(t_lhs, get_type(env, binop->rhs))) + repl_err(ast, "Comparisons between different types aren't supported"); const TypeInfo *info = type_to_type_info(t_lhs); size_t value_size = type_size(t_lhs); char lhs[value_size], rhs[value_size]; |
