2
0
mirror of https://github.com/m-labs/artiq.git synced 2025-02-08 16:43:19 +08:00
artiq/artiq/test/lit/embedding/error_attr_constant.py

19 lines
407 B
Python
Raw Normal View History

# RUN: %python -m artiq.compiler.testbench.embedding +diag %s 2>%t
# RUN: OutputCheck %s --file-to-check=%t
from artiq.language.core import *
from artiq.language.types import *
class c:
2016-05-03 16:23:16 +08:00
kernel_invariants = {"a"}
def __init__(self):
self.a = 1
i = c()
@kernel
def entrypoint():
# CHECK-L: ${LINE:+1}: error: cannot assign to constant attribute 'a' of class 'testbench.c'
i.a = 1