aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-12-31 23:20:14 +0000
committergingerBill <bill@gingerbill.org>2021-12-31 23:20:14 +0000
commit0d7cb02386c765f6f4fe343b463e84c3a7c1d1fc (patch)
treee20fab50f4f86623a05a510fcb4fc78382ef265f /src/check_expr.cpp
parentbdf66bb1e1096690be66eda90b35c6cfdc8a5cf0 (diff)
Fix conversion from float to quaternion
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 560e5e607..67e2f3bd7 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -649,6 +649,13 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
return 4;
}
}
+
+ if (is_type_complex_or_quaternion(dst)) {
+ Type *elem = base_complex_elem_type(dst);
+ if (are_types_identical(elem, base_type(src))) {
+ return 5;
+ }
+ }
if (is_type_array(dst)) {
Type *elem = base_array_type(dst);