# Tests that combining a definition with open spread (`...`) and a non-definition
# struct preserves the expected fields including hidden definitions and defaults.
# Issue: https://cuelang.org/issue/539
-- in.cue --
#Schema: {
	...
}

Component: {
	hostname: string | *"localhost"

	_#foo: {
		hello: "world"
	}
}

hello: #Schema & Component @test(closed) @test(eq, {
	hostname: *"localhost" | string
	_#foo: {hello: "world"}
})
-- out/eval/stats --
Leaks:  0
Freed:  14
Reused: 6
Allocs: 8
Retain: 0

Unifications: 10
Conjuncts:    17
Disjuncts:    4

NumCloseIDs: 2
