Commit 314a0f1c authored by Robert Bradshaw's avatar Robert Bradshaw

tiny fix, cleanup

parent 208ba244
...@@ -1207,13 +1207,15 @@ class ExpandInplaceOperators(EnvTransform): ...@@ -1207,13 +1207,15 @@ class ExpandInplaceOperators(EnvTransform):
lhs, let_ref_nodes = side_effect_free_reference(lhs, setting=True) lhs, let_ref_nodes = side_effect_free_reference(lhs, setting=True)
except ValueError: except ValueError:
return node return node
lhs.analyse_types(env)
dup = lhs.__class__(**lhs.__dict__) dup = lhs.__class__(**lhs.__dict__)
binop = binop_node(node.pos, binop = binop_node(node.pos,
operator = node.operator, operator = node.operator,
operand1 = dup, operand1 = dup,
operand2 = rhs, operand2 = rhs,
inplace=True) inplace=True)
# Manually analyse types for new node.
lhs.analyse_target_types(env)
dup.analyse_types(env)
binop.analyse_operation(env) binop.analyse_operation(env)
node = SingleAssignmentNode( node = SingleAssignmentNode(
node.pos, node.pos,
...@@ -1223,7 +1225,6 @@ class ExpandInplaceOperators(EnvTransform): ...@@ -1223,7 +1225,6 @@ class ExpandInplaceOperators(EnvTransform):
let_ref_nodes.reverse() let_ref_nodes.reverse()
for t in let_ref_nodes: for t in let_ref_nodes:
node = LetNode(t, node) node = LetNode(t, node)
# Manually analyse types for new node.
return node return node
def visit_ExprNode(self, node): def visit_ExprNode(self, node):
......
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