aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-08-16 12:02:14 +0100
committergingerBill <bill@gingerbill.org>2022-08-16 12:02:14 +0100
commit2c004dbcc92684c484078727897e04b74f01b28c (patch)
treeec472e957f0ec0aa7fc11c3b84b50e130ed4a834 /src/check_expr.cpp
parent4f7bbe0e4a14015dffb6c89faf1fc8d4cfb5d809 (diff)
Improve `matrix` conversion rules
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 310874139..9c2d20781 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -818,6 +818,10 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
}
if (is_type_matrix(dst)) {
+ if (are_types_identical(src, dst)) {
+ return 5;
+ }
+
Type *dst_elem = base_array_type(dst);
i64 distance = check_distance_between_types(c, operand, dst_elem);
if (distance >= 0) {