2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-21 09:26:29 +08:00
artiq/lit-test/test/embedding/error_attr_unify.py

18 lines
493 B
Python
Raw Normal View History

# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: OutputCheck %s --file-to-check=%t
from artiq.language.core import *
from artiq.language.types import *
class c:
x = [1, "x"]
@kernel
def entrypoint():
# CHECK-L: <synthesized>:1: error: cannot unify int(width='a) with str
# CHECK-NEXT-L: [1, 'x']
# CHECK-L: ${LINE:+1}: note: expanded from here
a = c
# CHECK-L: ${LINE:+1}: note: while inferring a type for an attribute 'x' of a host object
a.x