forked from M-Labs/artiq
Fix inference for multiple-target assignments.
This commit is contained in:
parent
9ff9f85f19
commit
c724e024ce
|
@ -652,12 +652,9 @@ class Inferencer(algorithm.Visitor):
|
|||
|
||||
def visit_Assign(self, node):
|
||||
self.generic_visit(node)
|
||||
if len(node.targets) > 1:
|
||||
self._unify(types.TTuple([x.type for x in node.targets]), node.value.type,
|
||||
node.targets[0].loc.join(node.targets[-1].loc), node.value.loc)
|
||||
else:
|
||||
self._unify(node.targets[0].type, node.value.type,
|
||||
node.targets[0].loc, node.value.loc)
|
||||
for target in node.targets:
|
||||
self._unify(target.type, node.value.type,
|
||||
target.loc, node.value.loc)
|
||||
|
||||
def visit_AugAssign(self, node):
|
||||
self.generic_visit(node)
|
||||
|
|
Loading…
Reference in New Issue