aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-19 12:26:10 +0000
committergingerBill <bill@gingerbill.org>2021-11-19 12:26:10 +0000
commit3e04b451062d4e46bd26baad82d7c75ce5e9e1d9 (patch)
tree9ef6b3dc5f574e6e17d9fab3064f964999bcc9bb /src/check_expr.cpp
parent12c1291805ce2aecc2f730c3db335e99181c7290 (diff)
Allow cast from float to complex
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 96ca2d308..3c884d117 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_complex(dst)) {
+ return true;
+ }
if (is_type_float(src) && is_type_quaternion(dst)) {
return true;
}