Commit 390ed7be authored by Stefan Behnel's avatar Stefan Behnel

minor fix for double inference

parent 10de298c
...@@ -262,11 +262,12 @@ class SimpleAssignmentTypeInferer: ...@@ -262,11 +262,12 @@ class SimpleAssignmentTypeInferer:
def find_spanning_type(type1, type2): def find_spanning_type(type1, type2):
if type1 is type2: if type1 is type2:
return type1 result_type = type1
elif type1 is PyrexTypes.c_bint_type or type2 is PyrexTypes.c_bint_type: elif type1 is PyrexTypes.c_bint_type or type2 is PyrexTypes.c_bint_type:
# type inference can break the coercion back to a Python bool # type inference can break the coercion back to a Python bool
# if it returns an arbitrary int type here # if it returns an arbitrary int type here
return py_object_type return py_object_type
else:
result_type = PyrexTypes.spanning_type(type1, type2) result_type = PyrexTypes.spanning_type(type1, type2)
if result_type in (PyrexTypes.c_double_type, PyrexTypes.c_float_type, Builtin.float_type): if result_type in (PyrexTypes.c_double_type, PyrexTypes.c_float_type, Builtin.float_type):
# Python's float type is just a C double, so it's safe to # Python's float type is just a C double, so it's safe to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment