forked from M-Labs/artiq
transforms.inferencer: allow variable as type of `n` in `[]*n`.
Fixes #473.
This commit is contained in:
parent
3589528362
commit
770dda6fd7
|
@ -407,7 +407,7 @@ class Inferencer(algorithm.Visitor):
|
||||||
return
|
return
|
||||||
elif builtins.is_list(left.type) or builtins.is_list(right.type):
|
elif builtins.is_list(left.type) or builtins.is_list(right.type):
|
||||||
list_, other = self._order_by_pred(builtins.is_list, left, right)
|
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()
|
printer = types.TypePrinter()
|
||||||
note1 = diagnostic.Diagnostic("note",
|
note1 = diagnostic.Diagnostic("note",
|
||||||
"list operand of type {typea}",
|
"list operand of type {typea}",
|
||||||
|
|
Loading…
Reference in New Issue