aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-30 13:43:24 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-30 13:43:24 -0400
commit56a44684faa9f91f5d5a794c3413ddd7dca93ca1 (patch)
treedbd7c585935aad7b64a73d048685363eaffc8006
parentf1d4f928e433293e5f7c19f1b1388337ed339b23 (diff)
More errors
-rw-r--r--repl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/repl.c b/repl.c
index c82f6efb..b458f08c 100644
--- a/repl.c
+++ b/repl.c
@@ -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];