diff options
| author | ftphikari <ftphikari@gmail.com> | 2022-06-08 19:55:42 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-08 19:55:42 +0300 |
| commit | 5d4291d9fa5921ebfcaf7be6bc1dbb18197c02ec (patch) | |
| tree | 6d6d6668795b59b0ddbdd947359d2900b4fda6c8 /src/check_expr.cpp | |
| parent | b70cd03e9ef2445d35dc5da9d58f2c79c3f4f7f5 (diff) | |
| parent | bfcb527b42832868ce0edf9817b3a00a933dcde8 (diff) | |
Merge branch 'odin-lang:master' into master
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
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; |