Commit 6e414031 authored by Stefan Behnel's avatar Stefan Behnel

smarter type analysis in BinopNode: propagate known Python result types

parent fabe1ee5
...@@ -4706,7 +4706,9 @@ class BinopNode(ExprNode): ...@@ -4706,7 +4706,9 @@ class BinopNode(ExprNode):
self.operand2.analyse_types(env) self.operand2.analyse_types(env)
if self.is_py_operation(): if self.is_py_operation():
self.coerce_operands_to_pyobjects(env) self.coerce_operands_to_pyobjects(env)
self.type = py_object_type self.type = self.result_type(self.operand1.type,
self.operand2.type)
assert self.type.is_pyobject
self.is_temp = 1 self.is_temp = 1
elif self.is_cpp_operation(): elif self.is_cpp_operation():
self.analyse_cpp_operation(env) self.analyse_cpp_operation(env)
......
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