# Tests that a default disjunct which embeds a struct referencing a sibling
# field, combined with an if-comprehension gated on a default boolean, does
# not panic. See: https://cuelang.org/issue/4339
-- in.cue --
_withExtra: extra: out.one

out: {
	*_withExtra | {}

	one: 1

	enable: *true | false
	if enable {}
} @test(eq,
	// TODO: we should be able to use @test(final) here, avoiding the defaults.
	*{one: 1, enable: *true | false, extra: 1} | {one: 1, enable: *true | false},
)
-- out/eval/stats --
Leaks:  11
Freed:  6
Reused: 0
Allocs: 17
Retain: 0

Unifications: 7
Conjuncts:    17
Disjuncts:    6

NumCloseIDs: 4
