2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 19:28:26 +08:00
artiq/lit-test/test/local_access/invalid_closure.py

16 lines
347 B
Python
Raw Normal View History

# 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
if False:
2015-07-19 16:44:51 +08:00
t = 1
# CHECK-L: ${LINE:+1}: error: variable 't' can be captured in a closure uninitialized
l = lambda: t
# CHECK-L: ${LINE:+1}: error: variable 't' can be captured in a closure uninitialized
def f():
return t
l()
f()