forked from M-Labs/artiq
1
0
Fork 0

transforms.iodelay_estimator: fix handling of methods.

This commit is contained in:
whitequark 2015-11-17 01:19:22 +03:00
parent b0c6b70971
commit 506725f78a
2 changed files with 13 additions and 1 deletions

View File

@ -258,7 +258,7 @@ class IODelayEstimator(algorithm.Visitor):
args = {} args = {}
for kw_node in node.keywords: for kw_node in node.keywords:
args[kw_node.arg] = kw_node.value args[kw_node.arg] = kw_node.value
for arg_name, arg_node in zip(typ.args, node.args[offset:]): for arg_name, arg_node in zip(list(typ.args)[offset:], node.args):
args[arg_name] = arg_node args[arg_name] = arg_node
free_vars = delay.duration.free_vars() free_vars = delay.duration.free_vars()

View File

@ -0,0 +1,12 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t
# CHECK-L: g: ()->NoneType delay(s->mu(1.0) mu)
def g(i):
i.f(1.0)
class c:
def f(self, x):
delay(x)
g(c())