mirror of https://github.com/m-labs/artiq.git
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):
|
def visit_Assign(self, node):
|
||||||
self.generic_visit(node)
|
self.generic_visit(node)
|
||||||
if len(node.targets) > 1:
|
for target in node.targets:
|
||||||
self._unify(types.TTuple([x.type for x in node.targets]), node.value.type,
|
self._unify(target.type, node.value.type,
|
||||||
node.targets[0].loc.join(node.targets[-1].loc), node.value.loc)
|
target.loc, node.value.loc)
|
||||||
else:
|
|
||||||
self._unify(node.targets[0].type, node.value.type,
|
|
||||||
node.targets[0].loc, node.value.loc)
|
|
||||||
|
|
||||||
def visit_AugAssign(self, node):
|
def visit_AugAssign(self, node):
|
||||||
self.generic_visit(node)
|
self.generic_visit(node)
|
||||||
|
|
Loading…
Reference in New Issue