# Tests that unifying a value with a definition that embeds a disjunction
# correctly retains both disjunction branches after concretizing some fields.
# Issue: after setting e.a = "hello" the two-branch disjunction (one with
# value?, one with externalValue?) should survive intact.
# https://cuelang.org/issue/353
-- in.cue --
e: #Example
e: {
	a: "hello"
	@test(eq, {a: "hello", value?: string} | {a: "hello", externalValue?: string})
}

#Example: {
	a: string
	{
		value?: string
	} | {
		externalValue?: string
	}
}
-- out/eval/stats --
Leaks:  0
Freed:  17
Reused: 7
Allocs: 10
Retain: 0

Unifications: 9
Conjuncts:    18
Disjuncts:    4

NumCloseIDs: 5
