Commit 1f714fd5 authored by Stefan Behnel's avatar Stefan Behnel

fix type inference for starred assignments

parent 905132e3
......@@ -778,7 +778,11 @@ class ControlFlowAnalysis(CythonTransform):
self.flow.mark_assignment(lhs, rhs, entry)
elif lhs.is_sequence_constructor:
for i, arg in enumerate(lhs.args):
self.mark_assignment(arg, rhs.inferable_item_node(i) if rhs else None)
if arg.is_starred:
item_node = object_expr
else:
item_node = rhs.inferable_item_node(i) if rhs else None
self.mark_assignment(arg, item_node)
else:
self._visit(lhs)
......
......@@ -62,7 +62,11 @@ class MarkParallelAssignments(EnvTransform):
elif isinstance(lhs, ExprNodes.SequenceNode):
for i, arg in enumerate(lhs.args):
self.mark_assignment(arg, rhs.inferable_item_node(i))
if arg.is_starred:
item_node = object_expr
else:
item_node = rhs.inferable_item_node(i) if rhs else None
self.mark_assignment(arg, item_node)
else:
# Could use this info to infer cdef class attributes...
pass
......
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