From 76ce364feaab09364a35ebcde65876ffef78907a Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 2 Jun 2015 08:53:11 +0300 Subject: [PATCH] Implement inferencing for AugAssign. --- artiq/py2llvm/typing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/artiq/py2llvm/typing.py b/artiq/py2llvm/typing.py index 5e270f052..c205ec984 100644 --- a/artiq/py2llvm/typing.py +++ b/artiq/py2llvm/typing.py @@ -216,6 +216,12 @@ class Inferencer(algorithm.Transformer): node.targets[0].loc, node.value.loc) return node + def visit_AugAssign(self, node): + node = self.generic_visit(node) + self._unify(node.target.type, node.value.type, + node.target.loc, node.value.loc) + return node + class Printer(algorithm.Visitor): def __init__(self, buf): self.rewriter = source.Rewriter(buf)