aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index f954f1583..58972d2cf 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -1618,6 +1618,9 @@ bool check_binary_op(CheckerContext *c, Operand *o, Token op) {
if (is_type_matrix(main_type)) {
error(op, "Operator '%.*s' is only allowed with matrix types", LIT(op.string));
return false;
+ } else if (is_type_simd_vector(main_type) && is_type_integer(type)) {
+ error(op, "Operator '%.*s' is only allowed with #simd types with integer elements", LIT(op.string));
+ return false;
}
/*fallthrough*/
case Token_Mul:
@@ -1669,6 +1672,9 @@ bool check_binary_op(CheckerContext *c, Operand *o, Token op) {
if (!is_type_integer(type)) {
error(op, "Operator '%.*s' is only allowed with integers", LIT(op.string));
return false;
+ } else if (is_type_simd_vector(main_type)) {
+ error(op, "Operator '%.*s' is only allowed with #simd types with integer elements", LIT(op.string));
+ return false;
}
break;