aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-03 12:45:19 +0000
committergingerBill <bill@gingerbill.org>2021-11-03 12:45:19 +0000
commit3d06dddb72e00409b14df36959bb3bcdc8d42999 (patch)
treee8d4b6db738ddb558362c841a4ddf234c554d1a7 /src/check_expr.cpp
parent9896205a062077b86d21c4866a1d1494868949ed (diff)
Allow casting from floats to quaternions
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 1e8c24fd6..2139cd777 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2453,6 +2453,9 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) {
return true;
}
+ if (is_type_float(src) && is_type_quaternion(dst)) {
+ return true;
+ }
if (is_type_complex(src) && is_type_quaternion(dst)) {
return true;
}