# A comprehension whose iterator passes through an inline-conjunction vertex
# (e.g. `({} & IMP).x.out`) propagated the surrounding context's cyclic
# flag to innocent pattern-body CallExprs (such as
# `list.Contains(["sm"], KIND)` whose only resolver argument is a
# LabelReference). The CallExprs were deferred for cycle-break and never
# rescheduled because no non-cyclic conjunct arrived on those leaf nodes,
# leaving `mon` as _ and the dynamic key `(obj.n)` as _|_.
#
# Label-only-resolver CallExprs trapped in a cyclic deferment
# are flushed when the node has no other path to a value.
-- in.cue --
import "list"

#NS: [KIND=string]: [string]: {
	mon: list.Contains(["sm"], KIND)
	n:   "\(mon)"
}

#Foo: {
	A:   _
	IMP: _
	out: [
		for _, obj in A
		for a, _ in (#NS & {sm: (obj.n): {}}).sm {a},
		for _, obj in ({} & IMP).x.out {obj},
	]
}

_fake: x: #Foo & {
	A:   obj: (#NS & {dep: obj: {}}).dep.obj
	IMP: x: out: []
}

export: #Foo & {A: {}, IMP: _fake}

result: export.out @test(eq, ["false"])
-- out/errors.txt --
[incomplete] #Foo.out: cannot range over A (incomplete type _):
    ./in.cue:12:17
-- out/eval/stats --
Leaks:  0
Freed:  81
Reused: 51
Allocs: 30
Retain: 0

Unifications: 71
Conjuncts:    136
Disjuncts:    0

NumCloseIDs: 32
