Browse Source

Allow cast from float to complex

gingerBill 3 years ago
parent
commit
3e04b45106
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/check_expr.cpp

+ 3 - 0
src/check_expr.cpp

@@ -2453,6 +2453,9 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) {
 		return true;
 		return true;
 	}
 	}
 
 
+	if (is_type_float(src) && is_type_complex(dst)) {
+		return true;
+	}
 	if (is_type_float(src) && is_type_quaternion(dst)) {
 	if (is_type_float(src) && is_type_quaternion(dst)) {
 		return true;
 		return true;
 	}
 	}