small bugfix for binary operator checking
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 10 Aug 2020 15:19:16 +0000 (10:19 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 10 Aug 2020 15:19:16 +0000 (10:19 -0500)
onyx
src/onyxchecker.c

diff --git a/onyx b/onyx
index cc695e09207abd7690ae61278ce3b30081b33bfc..75bf841a04a72597ff158b95741bb4bda0b070ee 100755 (executable)
Binary files a/onyx and b/onyx differ
index 8be74b0a5d2ff242430b62bf92796c3b504f8498..ac964dca94b459d2119f6c1fccdb2710d25e6478 100644 (file)
@@ -504,10 +504,10 @@ CHECK(binaryop, AstBinaryOp* binop, b32 assignment_is_ok) {
         || binop->operation == Binary_Op_Bool_Or)
         return check_binaryop_bool(binop);
 
-    if (!type_is_numeric(binop->left->type)) {
+    if (!type_is_numeric(binop->left->type) && !type_is_pointer(binop->left->type)) {
         onyx_message_add(Msg_Type_Literal,
                 binop->token->pos,
-                "expected numeric type for left side of binary operator");
+                "expected numeric or pointer type for left side of binary operator");
         return 1;
     }