-- in.cue --
#E: {
	a: {b: int}
}

#S: {
	#E
	a: {c: int}
	b: 3
} @test(eq, {
	a: {b: int, c: int}
	b: 3
})

// adding a field to a nested struct that is closed.
#e1: #S & {a: d: 4} @test(err, at=a.d, code=eval,
	contains="field not allowed", pos=[0:15])

// literal struct not closed until after unification.
#v1: #S & {a: c: 4} @test(eq, {a: {b: int, c: 4}, b: 3})
-- out/errors.txt --
[eval] #e1.a.d: field not allowed:
    ./in.cue:15:15
-- out/eval/stats --
Leaks:  0
Freed:  20
Reused: 10
Allocs: 10
Retain: 0

Unifications: 20
Conjuncts:    36
Disjuncts:    0

NumCloseIDs: 11
-- out/diff-v2-v3.txt --
Reordering / missing positions.
Verdict: worsening -- v3 reports fewer error positions; field reordering.
