! cue eval errs.cue
cmp stderr expect-stderr
cmp stdout expect-stdout

-- expect-stdout --
-- expect-stderr --
bar.b: conflicting values 2 and string (mismatched types int and string)
x.q: incompatible values "goodbye" and "hello"
-- errs.cue --
a: "hello"
b: "goodbye"
x: {q: a, q: b}

foo: {a: int} | {b: string}
bar: foo & {a: "str", b: 2}

