harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 622705fe7be0403a0e2ae0d80221187eee355adb
parent 7e03ad0725a15f0775db2c69a5f1fddfaab7d704
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  1 Feb 2021 16:07:13 -0500

check: use expect for type promotion TODO

Just to make it easier to identify these errors until we finish
implementing it.

Diffstat:
Msrc/check.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/check.c b/src/check.c @@ -341,7 +341,9 @@ check_expr_binarithm(struct context *ctx, case BIN_TIMES: case BIN_BXOR: // TODO: Promotion - assert(lvalue->result->storage == rvalue->result->storage); + expect(&aexpr->loc, + lvalue->result->storage == rvalue->result->storage, + "TODO: type promotion"); expr->result = lvalue->result; break; // Logical arithmetic @@ -355,7 +357,9 @@ check_expr_binarithm(struct context *ctx, case BIN_LXOR: case BIN_NEQUAL: // TODO: Promotion, comparibility rules - assert(lvalue->result->storage == rvalue->result->storage); + expect(&aexpr->loc, + lvalue->result->storage == rvalue->result->storage, + "TODO: type promotion"); expr->result = &builtin_type_bool; break; }