# `!=` applied to a disjunction before structural cycle is concrete:
# CUE incorrectly reports an empty disjunction error instead of handling
# the abstract `!=` constraint between fields sharing a disjunction type.
# https://cuelang.org/issue/241
-- in.cue --
#Value: 0 | 1

foo: #Value  @test(err, code=cycle|incomplete, args=[bar], pos=[-2:13, 2:6, 3:6])
foo: !=bar
bar: #Value  @test(eq, 0 | 1)
bar: !=foo   @test(err:todo, code=cycle|incomplete)

#Value: 0 | 1

Foo: #Value  @test(eq, 1)
Foo: !=Bar
Bar: #Value  @test(eq, 0)
Bar: !=Foo
Bar: 0

cell: a: 0 | 1
cell: a: !=cell.b
cell: b: 0 | 1
cell: b: !=cell.a
cell: a: 0   @test(eq, 0)
cell: b: _   @test(eq, 1)

a: cell.a  @test(eq, 0)
b: cell.b  @test(eq, 1)
-- out/errors.txt --
[cycle] foo: cycle across unresolved disjunction referenced by bar:
    ./in.cue:1:13
    ./in.cue:5:6
    ./in.cue:6:6
-- out/eval/stats --
Leaks:  6
Freed:  37
Reused: 25
Allocs: 18
Retain: 0

Unifications: 11
Conjuncts:    66
Disjuncts:    32

NumCloseIDs: 4
