aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-21 00:04:22 +0100
committergingerBill <bill@gingerbill.org>2021-10-21 00:04:22 +0100
commitd67d7168e2d4ed8e0e5f0d1b23aba5e5ebac6847 (patch)
tree915285beb2ebeb9a4cdec02ba0992e08435dd3eb /src/check_expr.cpp
parent3b3e7550f62c8f61ac4368d3ed6bf4d385fa9508 (diff)
Allow scalars with matrices
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 8a1e5fd86..498bf78c7 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -657,6 +657,14 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
return distance + 6;
}
}
+
+ if (is_type_matrix(dst)) {
+ Type *elem = base_array_type(dst);
+ i64 distance = check_distance_between_types(c, operand, elem);
+ if (distance >= 0) {
+ return distance + 7;
+ }
+ }
if (is_type_any(dst)) {
if (!is_type_polymorphic(src)) {