tiny fix, cleanup
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 14 Nov 2010 08:08:49 +0000 (00:08 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 14 Nov 2010 08:08:49 +0000 (00:08 -0800)
Cython/Compiler/ParseTreeTransforms.py

index 1530c0c9d05124cec809a9a463cb0ff3ebc52071..ae5bb142a9ef4b409f442aa5c69e6440fb72bc0e 100644 (file)
@@ -1207,13 +1207,15 @@ class ExpandInplaceOperators(EnvTransform):
             lhs, let_ref_nodes = side_effect_free_reference(lhs, setting=True)
         except ValueError:
             return node
-        lhs.analyse_types(env)
         dup = lhs.__class__(**lhs.__dict__)
         binop = binop_node(node.pos, 
                            operator = node.operator,
                            operand1 = dup,
                            operand2 = rhs,
                            inplace=True)
+        # Manually analyse types for new node.
+        lhs.analyse_target_types(env)
+        dup.analyse_types(env)
         binop.analyse_operation(env)
         node = SingleAssignmentNode(
                             node.pos, 
@@ -1223,7 +1225,6 @@ class ExpandInplaceOperators(EnvTransform):
         let_ref_nodes.reverse()
         for t in let_ref_nodes:
             node = LetNode(t, node)
-        # Manually analyse types for new node.
         return node
 
     def visit_ExprNode(self, node):