From 770dda6fd78e3113077ccd6de6a31266429d549c Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 16 Jun 2016 13:32:14 +0000 Subject: [PATCH] transforms.inferencer: allow variable as type of `n` in `[]*n`. Fixes #473. --- artiq/compiler/transforms/inferencer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/inferencer.py b/artiq/compiler/transforms/inferencer.py index 4149c7392..7404e09cb 100644 --- a/artiq/compiler/transforms/inferencer.py +++ b/artiq/compiler/transforms/inferencer.py @@ -407,7 +407,7 @@ class Inferencer(algorithm.Visitor): return elif builtins.is_list(left.type) or builtins.is_list(right.type): list_, other = self._order_by_pred(builtins.is_list, left, right) - if not builtins.is_int(other.type): + if not builtins.is_int(other.type) and not types.is_var(other.type): printer = types.TypePrinter() note1 = diagnostic.Diagnostic("note", "list operand of type {typea}",