From 7e886ddc895ca7c5e9c461762137b4857b1a97d3 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 2 Mar 2017 16:15:37 +0000 Subject: [PATCH] transforms.inferencer: do not unnecessarily mutate typedtree. This caused the hash to change after every iteration of inference, if the result of any coercion was an integer of indefinite width. --- artiq/compiler/transforms/inferencer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/inferencer.py b/artiq/compiler/transforms/inferencer.py index 0c72b5ac6..11e2dfef2 100644 --- a/artiq/compiler/transforms/inferencer.py +++ b/artiq/compiler/transforms/inferencer.py @@ -293,7 +293,8 @@ class Inferencer(algorithm.Visitor): return coerced_node elif isinstance(coerced_node, asttyped.CoerceT): node = coerced_node - node.type, node.other_value = typ, other_node + node.type.unify(typ) + node.other_value = other_node else: node = asttyped.CoerceT(type=typ, value=coerced_node, other_value=other_node, loc=coerced_node.loc)