2015-07-29 19:32:34 +08:00
|
|
|
# RUN: %python -m artiq.compiler.testbench.signature +diag %s >%t
|
2015-07-19 16:44:51 +08:00
|
|
|
# RUN: OutputCheck %s --file-to-check=%t
|
|
|
|
|
2015-08-23 04:31:09 +08:00
|
|
|
if False:
|
2015-07-19 16:44:51 +08:00
|
|
|
t = 1
|
2015-07-19 17:08:26 +08:00
|
|
|
|
|
|
|
# CHECK-L: ${LINE:+1}: error: variable 't' can be captured in a closure uninitialized
|
2015-07-23 08:15:36 +08:00
|
|
|
l = lambda: t
|
2015-07-19 17:08:26 +08:00
|
|
|
|
|
|
|
# CHECK-L: ${LINE:+1}: error: variable 't' can be captured in a closure uninitialized
|
|
|
|
def f():
|
|
|
|
return t
|
2015-08-23 04:31:09 +08:00
|
|
|
|
|
|
|
l()
|
|
|
|
f()
|