From 506725f78abec6ba20ce11397a7441c66158e614 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 17 Nov 2015 01:19:22 +0300 Subject: [PATCH] transforms.iodelay_estimator: fix handling of methods. --- artiq/compiler/transforms/iodelay_estimator.py | 2 +- lit-test/test/iodelay/class.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 lit-test/test/iodelay/class.py diff --git a/artiq/compiler/transforms/iodelay_estimator.py b/artiq/compiler/transforms/iodelay_estimator.py index aaae55676..a28e9e793 100644 --- a/artiq/compiler/transforms/iodelay_estimator.py +++ b/artiq/compiler/transforms/iodelay_estimator.py @@ -258,7 +258,7 @@ class IODelayEstimator(algorithm.Visitor): args = {} for kw_node in node.keywords: 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 free_vars = delay.duration.free_vars() diff --git a/lit-test/test/iodelay/class.py b/lit-test/test/iodelay/class.py new file mode 100644 index 000000000..32580c4c6 --- /dev/null +++ b/lit-test/test/iodelay/class.py @@ -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())