#name: combined definitions
#evalPartial
-- in.cue --
// Allow combining of structs within a definition
#D1: {
	env: a: "A"
	env: b: "B"
	#def: {a: "A"}
	#def: {b: "B"}
}
d1: #D1 & {env: c: "C" } @test(err, at=env.c, code=eval, contains="field not allowed", pos=[0:17])
#D2: {
	a: int
}
#D2: {
	b: int
} @test(eq, {a: int, b: int})
#D3: {
	env: a: "A"
}
#D3: {
	env: b: "B"
} @test(eq, { env: { a: "A", b: "B" } })
#D4: {
	env: #DC
	env: b: int @test(err, code=eval, contains="field not allowed", pos=[0:7])
}
#DC: {a: int}
-- out/errors.txt --
[eval] d1.env.c: field not allowed:
    ./in.cue:8:17
[eval] #D4.env.b: field not allowed:
    ./in.cue:23:7
-- out/eval/stats --
Leaks:  0
Freed:  29
Reused: 17
Allocs: 12
Retain: 0
Unifications: 29
Conjuncts:    41
Disjuncts:    0
NumCloseIDs: 2
-- out/diff-v2-v3.txt --
Missing positions: v3 reports fewer positions than v2 for "field not allowed" errors.
Reordering: v3 outputs some fields in different order than v2.
