# Tests a comprehension with a disjunction of close({}) and a pattern
# constraint. Issue: https://cuelang.org/issue/312 — the default selection
# and closing behavior of a disjunction inside a comprehension should work
# correctly.
#name: issue312
#evalFull
-- in.cue --

for x in [1] {
	*close({}) | {[_]: null}
}

@test(eq, *{} | {})
-- out/eval/stats --
Leaks:  0
Freed:  7
Reused: 1
Allocs: 6
Retain: 0

Unifications: 5
Conjuncts:    10
Disjuncts:    2

NumCloseIDs: 4
