-- in.cue --
embed: simple: {
	#A: b: 1
	a: { #A }
	a: err: 1 @test(err, code=eval, contains="field not allowed", pos=[0:5])
}
embed: andInStruct: {
	#Foo: a: int
	a: { #Foo & { err: 2 } }

	@test(err, at=a.err, code=eval, contains="field not allowed", pos=[2:16])
}
embed: embedDefWithEmbedding: {
	#Foo: {{a: int}}
	a: { #Foo & { err: 2 } } // not allowed

	@test(err, at=a.err, code=eval, contains="field not allowed", pos=[2:16])
}
embed: embedComprehension: {
	#Foo: {if true {a: int}}
	a: { #Foo & { err: 2 } } // not allowed

	@test(err, at=a.err, code=eval, contains="field not allowed", pos=[2:16])
}
embed: fieldWithAnd: {
	#A: {}
	{ a: #A & {err: 3 } }

	@test(err, at=a.err, code=eval, contains="field not allowed", pos=[2:13])
}
embed: embedAndRecursive: {
	#A: a: int
	B: x: #A
	B & { x: err: 2 }

	@test(err, at=x.err, code=eval, contains="field not allowed", pos=[3:11])
}
embed: andEmbed: {
	#A: b: int
	#B: b: int
	#D: {#A & #B}
	d: #D & {err: 3}

	@test(err, at=d.err, code=eval, contains="field not allowed", pos=[4:11])
}
and: transitive: ok: {
	Z: {a: string} @test(shareID:todo=Z)
	#Y: Z          @test(shareID:todo=Z)
	#X: #Y & Z
	out: #X & {
		a: "foo"
	}

	@test(eq, {
		Z: {a: string}
		#Y: {a: string}
		#X: {a: string}
		out: {a: "foo"}
	})
}
and: transitive: err: {
	Z: a: string
	#Y: Z
	#X: #Y & Z
	out: #X & {
		err: "foo"
	} @test(err, at=err, code=eval, contains="field not allowed", pos=[1:3])
}
and: transitiveWithEmbed: ok: {
	Z: a: string
	#X: #Y & Z
	#Y: {Z}
	out: #X & {
		a: "foo"
	}

	@test(eq, {
		Z: {a: string}
		#X: {a: string}
		#Y: {a: string}
		out: {a: "foo"}
	})
}
and: transitiveWithEmbed: err: {
	Z: a: string
	#X: #Y & Z
	#Y: {Z}
	out: #X & {
		err: "foo"
	}

	@test(err, at=out.err, code=eval, contains="field not allowed", pos=[5:3])
}
embed: nonDef: t1: {
	X: a: string
	#Y: #Z & X
	#Z: {
		X
		b?:    string
	}

	@test(eq, {
		X: {a: string}
		#Y: {b?: string, a: string}
		#Z: {b?: string, a: string}
	})
}
embed: defAndHidden: full: {
	_stepCommon: Name: string
	#Step: #Command & _stepCommon
	#Command: {
		_stepCommon
		Path?:    string
	}
	out: #Step & {
		Name: "foo"
	}

	@test(eq, {
		_stepCommon: {Name: string}
		#Step: {Path?: string, Name: string}
		#Command: {Path?: string, Name: string}
		out: {Name: "foo", Path?: string}
	})
}
embed: withIndirect: {
	A: #B
	#B: b: int
	A & { err: 2 } // not allowed

	@test(err, at=err, code=eval, contains="field not allowed", pos=[3:8])
}
-- validators.cue --
import (
	"struct"
	"list"
)

embed: normalValidator: {
	#X: {
		struct.MaxFields(1)
		a?: int
		b?: int
	}
	x: #X
	x: err: 1 @test(err, code=eval, contains="field not allowed", pos=[-5:3, 0:5])
}
embed: openValidator: t1: {
	#X: {
		matchN(0, [])
		a?: int
		b?: int
	}
	x: #X
	x: err: 1

	@test(eq, {
		#X: {matchN(0, []), a?: int, b?: int}
		x: {err: 1, a?: int, b?: int}
	})
}
embed: openValidator: t2: {
	Y: matchN(1, [X])
	X: b?: Y
	a: X
	a: b: 1 @test(err, suberr=(code=eval, contains="conflicting values"),
		suberr=(code=eval, contains="does not satisfy matchN", pos=[-3:5, -3:12, -2:9, 0:8]),
	)
}
disjunction: withErr: t1: {
	params: {}
	out: #Schema1 & {
		b1: b2: b3: params.mayExistLater
	}
	#Schema1: b1?: null | #Schema2
	#Schema2: b2?: null | {b3?: string}

	@test(eq, {
		params: {}
		out: {b1: {b2: {b3: _}}}
		#Schema1: {b1?: null | {b2?: null | {b3?: string}}}
		#Schema2: {b2?: null | {b3?: string}}
	})
}
embed: nestedValidator: {
	#types: z?: list.UniqueItems
	x: y: z: [1]
	x: {
		#def
		y?: #types
	}
	#def: {}

	@test(eq, {
		#types: _ @test(ignore)
		x: {y: {z: [1]}}
		#def: {}
	})
}
-- inline.cue --
embedInline: {
	#Schema: {
		a: "hello"
		// do not close outer struct of 'b', as inlined value is not a schema.
		b: { {x: c: "foo"}.x }
		b: {
			c: string
			d: "never printed"
		}
	}
	out: #Schema & __no_sharing

	@test(eq, {
		#Schema: {a: "hello", b: {c: "foo", d: "never printed"}}
		out: {a: "hello", b: {c: "foo", d: "never printed"}}
	})
}
// evalv3 "field not allowed" regression involving embeddings and selectors;
// accessing a field via selector on an embedded definition should stay open.
// https://cuelang.org/issue/3853
issue3853: {
	#Schema: {
		a: "hello"
		// do not close outer struct of 'b', as inlined value is not a schema.
		b: { {x: c: "foo"}.x }
		b: {
			c: string
			d: "never printed"
		}
	}
	out: {x: (#Schema & {}).a}.x

	@test(eq, {
		#Schema: {a: "hello", b: {c: "foo", d: "never printed"}}
		out: "hello"
	})
}
-- disjunction.cue --
import "list"

// evalv3 regression: closedness errors no longer reported when default values
// are present; disallowed fields in a default disjunct should still be caught.
// https://cuelang.org/issue/3947
issue3947: full: {
	#Schema: allowed?: string
	_defaults: disallowed: _ | *"default value"
	out: #Schema & _defaults @test(err, code=eval, at=disallowed, contains="field not allowed", pos=[-1:13])
}
// evalv3 regression: #oneOf pattern disjunction; unifying a closed definition
// disjunction with a default string field caused incorrect field-not-allowed errors.
// https://cuelang.org/issue/3957
issue3957: reduced: {
	c: a: "bar"
	c: #B & {a: string | *"foo"}
	#B: b?: string

	@test(err, at=c.a, code=eval, contains="field not allowed", pos=[1:5, 2:11])
}
issue3957: full: {
	#oneof: {a: string} | {b?: [...string]}
	c: #oneof & {a: string | *"foo"}
	c: a: "bar"

	@test(eq, {
		#oneof: {a: string} | {b?: []}
		c: {a: "bar"}
	})
}
issue3957: derived: t1: {
	#Schema: {
		in: string | [...string]
		out: list.FlattenN([in], 1)
	}
	x: #Schema & {in: "foo"}

	@test(eq, {
		#Schema: {in: string | [], out: [string | []]}
		x: {in: "foo", out: ["foo"]}
	})
}
issue3957: derived: t2: {
	#Schema: {
		in: string | [...string]
		let _flat = list.FlattenN([in], 1)
		out: _flat
	}
	out: #Schema & {in: "foo"}

	@test(eq, {
		#Schema: {in: string | [], out: [string | []]}
		out: {in: "foo", out: ["foo"]}
	})
}
-- issue3833.cue --
// evalv3 "field not allowed" regression with embeddings; combining a definition
// that has an open field with another definition via embedding should be allowed.
// https://cuelang.org/issue/3833
issue3833: ok: {
	out: { #A & { a: #B } }
	#A: {
		a: {b: string, ...}
		...
	}
	#C: c: string
	#B: {
		#C & {c: "foo"}
		b: "foo"
	}

	@test(eq, {
		out: {a: {b: "foo", c: "foo"}}
		#A: {a: {b: string}}
		#C: {c: string}
		#B: {c: "foo", b: "foo"}
	})
}
issue3833: evalv2Issue:{
	out: { #A & { a: #B } }
	#A: {
		a: b: string
		...
	}
	#C: c: string
	#B: {
		#C & {c: "foo"}
		b: "foo"
	}

	@test(err, at=out.a.c, code=eval,
		contains="field not allowed", pos=[6:6, 8:9],
		hint="key positions are missing",
	)
}
-- issue3837.cue --
// evalv3 regression with embeddings, disjunctions, and extra fields; a struct
// that embeds a definition and adds extra fields should not cause spurious errors.
// https://cuelang.org/issue/3837
issue3837: reduced: {
	A: {
		#Embed
		extra: "foo"
	}
	out: {{ x: A & __no_sharing }}
	#Embed: {}

	@test(eq, {
		A: {extra: "foo"}
		out: {x: {extra: "foo"}}
		#Embed: {}
	})
}
issue3837: full: {
	#Embed: {}
	#A: {
		#Embed
		extra: "foo"
	}
	#B: (#C | {})
	#C: bar: string
	out: #B & {
		bar: "baz"
		{
			#def: (#A & __no_sharing)
		}
	}

	@test(eq, {
		#Embed: {}
		#A: {extra: "foo"}
		#B: {bar: string} | {}
		#C: {bar: string}
		out: {bar: "baz", #def: {extra: "foo"}}
	})
}
-- issue3832.cue --
// evalv3 "field not allowed" regression with a disjunction and a let field;
// a let binding inside a disjunct should not cause closedness errors.
// https://cuelang.org/issue/3832
issue3832: {
	_person: self: firstName: "Sam"

	#T: {
		_subject: {
			in:  _
			out: {
				let self = in.self
				outFirstName: self.firstName
			}
		}
		_assert: pass: _
		_assert: {
			check!: _
			pass:   "never"
		} | {
			invoke!: _
			// TODO: here, the let from _subject.out gets converted to a
			// permanent error,instead of incomplete.
			pass:    (_subject & {in: invoke}).out
		}
		results: _assert.pass
	}
	#T & {
		_assert: invoke: _person
	}

	@test(eq, {
		_person: {self: {firstName: "Sam"}}
		#T: _ @test(ignore)
		_assert: {
			invoke: {self: {firstName: "Sam"}}
			pass: {outFirstName: "Sam"}
		}
		_subject: _ @test(ignore)
		results: {outFirstName: "Sam"}
	})
}
-- issue3839.cue --
// evalv3 closedness regression with embeddings and definitions; embedding a
// definition with an ellipsis inside a non-definition should remain open.
// https://cuelang.org/issue/3839
issue3839: reduced: {
	x: { A & __no_sharing }
	x: y: 1
	#B: {
		// Note: true with both old semantics and explicitopen
		@test(closed)
		@test(allows=false, string)
	}
	A: {
		#B
		...

		// Note: true with both old semantics and explicitopen
		@test(closed)
		@test(allows, string)
	}

	@test(eq, {x: {y: 1}, #B: {}, A: {}})
}
issue3839: full: {
	_globals: glb: globalField: ""

	#GlobalContext: globalField: string
	#Context: {
		glb: #GlobalContext
		out: glb
	}
	out: {
		ingress: {
			#Ingress & {
				#def: (#Context & _globals).out
			}
		}

		ingress?: {
			foo: 1234
			bar: "http"
		}
	}
	#Embed: #def: {...}

	#Ingress: {
		#Embed
		...
	}

	@test(eq, {
		_globals: {glb: {globalField: ""}}
		#GlobalContext: {globalField: string}
		#Context: {glb: {globalField: string}, out: {globalField: string}}
		out: {ingress: {#def: {globalField: ""}, foo: 1234, bar: "http"}}
		#Embed: {#def: {}}
		#Ingress: {#def: {}}
	})
}
-- chaineddef.cue --
// evalv3 "field not allowed" regression when embedding a chain of definitions;
// chained optional-field definitions embedded in a struct should not be enforced.
// https://cuelang.org/issue/3920
// chained definitions should be handled correctly within embeddings.
issue3920: {
	out: {
		#A
		a: b: "out" // do not enforce #B
	}
	#A: a?: #B
	#B: c?: string

	@test(eq, {
		out: {a: {b: "out", c?: string}}
		#A: {a?: {c?: string}}
		#B: {c?: string}
	})
}
onlyCloseDirectStruct: {
	#foo: {}
	x: {y: {{a: #foo}}}
	x: y: b: 1

	@test(eq, {#foo: {}, x: {y: {a: {}, b: 1}}})
}
closeInEmbed: {
	x: {close({{["d"]: f: int}})}
	x: d: e: 1

	@test(eq, {x: {d: {e: 1, f: int}}})
}
-- embedelim.cue --
// evalv3 "field not allowed" regression with nested definitions; eliminating
// an embedded top value from a definition should not incorrectly close the struct.
// https://cuelang.org/issue/3921
issue3921: top: {
	#A: #B
	#A: b: string
	#B: _
	a: {#A & {}}

	@test(eq, {#A: {b: string}, #B: _, a: {b: string}})
}
issue3921: hidden: {
	#A: #B
	#A: _hidden: b: string
	#B: {}
	a: { #A & { _hidden: {} }}

	@test(eq, {
		#A: {_hidden: {b: string}}
		#B: {}
		a: {_hidden: {b: string}}
	})
}
issue3921: full: {
	out: #templateList & #defineMap
	#templateList: {
		#stepMap: [string]: _
		stepList: [for c in #stepMap {c}]
	}
	#defineMap: {
		#stepMap: foo: #Step & {
			image: "bar"
			#config: {}
		}
		stepList: _
	}
	#Step: #StepInner & {
		image: string
		#config: version:   string
	}
	#StepInner: image: string

	@test(eq, {
		out: {
			#stepMap: {foo: {
				image: "bar"
				#config: {version: string}
			}}
			stepList: [{
				image: "bar"
				#config: {version: string}
			}]
		}
		#templateList: {#stepMap: {}, stepList: []}
		#defineMap: {
			#stepMap: {foo: {
				image: "bar"
				#config: {version: string}}
			}
			stepList: _
		}
		#Step: {
			image: string
			#config: {version: string}
		}
		#StepInner: {image: string}
	})
}
-- issue3843.cue --
// evalv3 "field not allowed" regression when a definition is reused at
// multiple levels and pattern constraints are unified more than once.
// https://cuelang.org/issue/3843
// Pattern is unified twice. Ensure that deduping is handled correctly.
dedupPattern: t1: p1: {
	A: {
		#Z: [string]: _
		x: #Z
		x: y: z: 1
	}
	B: A & __no_sharing
	out: A.#Z & B.x

	@test(eq, {
		A: {#Z: {}, x: {y: {z: 1}}}
		B: {#Z: {}, x: {y: {z: 1}}}
		out: {y: {z: 1}}
	})
}
dedupPattern: t1: p2: {
	A: {
		#Z: [string]: _
		x: #Z
		x: y: z: 1
	}
	B: A & __no_sharing
	out: B.x & A.#Z

	@test(eq, {
		A: {#Z: {}, x: {y: {z: 1}}}
		B: {#Z: {}, x: {y: {z: 1}}}
		out: {y: {z: 1}}
	})
}
-- issue3858.cue --
// evalv3 "field not allowed" regression with embeddings where a definition
// with an embedded field reference was incorrectly rejected.
// https://cuelang.org/issue/3858
orig: t1: {
	#Image: embed: image: "foo:v1"
	#JobConfig: {
		image: #Image
		job: #Job & {
			image.embed
		}
	}
	#Job: {
		image: string
		vcs:   "git"
		args:  [...string]
		env:   [string]: string
	}

	#Output: {
		_in:  _
		out:  (_in & {})
	}
	#Output & {
		_in: (#JobConfig & {}).job
	}

	@test(eq, {
		#Image: {embed: {image: "foo:v1"}}
		#JobConfig: {
			image: {embed: {image: "foo:v1"}}
			job: {image: "foo:v1", vcs: "git", args: [], env: {}}
		}
		#Job: {image: string, vcs: "git", args: [], env: {}}
		#Output: {_in: _, out: {}}
		_in: {image: "foo:v1", vcs: "git", args: [], env: {}}
		out: {image: "foo:v1", vcs: "git", args: [], env: {}}
	})
}
reduced: t1: {
	Y: {
		a: e: "foo"
		b: X & { a }
	}
	X: {
		e: string
		f: 1 // fails in `out`
	}
	#Z: {
		_in:  _
		out:  _in & __no_sharing
	}
	#Z & {
		_in: Y
	}

	@test(eq, {
		Y: {a: {e: "foo"}, b: {e: "foo", f: 1}}
		X: {e: string, f: 1}
		#Z: {_in: _, out: _}
		_in: {a: {e: "foo"}, b: {e: "foo", f: 1}}
		out: {a: {e: "foo"}, b: {e: "foo", f: 1}}
	})
}
orig: t2: {
	#JobConfig: {
		image: spec: image: "someimage"
		job: #Job & {
			image.spec
		}
	}
	#Job: {
		image: string
		env:   "FOO"
	}
	#Output: {
		in: _
		out: (in & {}).input
	}
	out: #Output & {
		in: input: (#JobConfig & {}).job
	}

	@test(eq, {
		#JobConfig: {
			image: {spec: {image: "someimage"}}
			job: {image: "someimage", env: "FOO"}
		}
		#Job: {image: string, env: "FOO"}
		#Output: {
			in: _
			out: _ @test(ignore)
		}
		out: {
			in: {input: {image: "someimage", env: "FOO"}}
			out: {image: "someimage", env: "FOO"}
		}
	})
}
reduced: t2: {
	Y: {
		a: e: "foo"
		b: X & { a }
	}
	X: {
		e: string
		f: 1 // fails
	}
	#Z: {
		_in:  _
		out:  _in
	}
	#Z & { _in: Y }

	@test(eq, {
		Y: {a: {e: "foo"}, b: {e: "foo", f: 1}}
		X: {e: string, f: 1}
		#Z: {_in: _, out: _}
		_in: {a: {e: "foo"}, b: {e: "foo", f: 1}}
		out: {a: {e: "foo"}, b: {e: "foo", f: 1}}
	})
}
-- issue3934.cue --
// evalv3 "field not allowed" regression with disjunctions and a comprehension;
// a false-branch comprehension inside a disjunct should not trigger closedness errors.
// https://cuelang.org/issue/3934
issue3934: {
	out: #Foo & {
		foo: {
			if false {
				extra: nested: 123
			}
		}
	}
	#Foo: foo?: null | #Bar | *{bar: 3}
	#Bar: {
		bar?:   int
		extra?: null | {...}
	}

	@test(eq, {
		out: {foo: *{bar: 3} | {extra?: null | {}, bar?: int} | null}
		#Foo: {foo?: *{bar: 3} | {bar?: int, extra?: null | {}} | null}
		#Bar: {bar?: int, extra?: null | {}}
	})
}
-- large.cue --
full: {
	#Resource: {
		someMsg: string
		obs: {} | *{missing: true}

		let pickMsg = [
			if obs.missing {msg: "\(someMsg)"},
			{msg: "bar"},
		][0]
		patches: [{
			op:    "add"
			path:  "/metadata"
			value: pickMsg.msg
		}]
	}

	#Patches: [string]: _
	#JSONPatch: {
		namespace?: string
		patch: [...#JSONOp]
		output: #Patches & {(namespace): patch}
	}
	#JSONOp: {
		op:    "add"
		path:  string
		value: _
	} | {
		op:   "remove"
		path: string
	}

	#Main: {
		NS=namespace: string

		output: jsonPatch.output

		let jsonPatch = #JSONPatch & {
			let base = #Resource & {}
			let withMsg = base & {someMsg: "foo"}

			namespace: NS

			patch: withMsg.patches
		}
	}
	out: (#Main & {namespace: "ns1"}).output

	@test(eq, {
		#Resource: _ @test(ignore)
		#Patches: _ @test(ignore)
		#JSONPatch: _ @test(ignore)
		#JSONOp: _ @test(ignore)
		#Main: _ @test(ignore)
		out: {ns1: [{op: "add", path: "/metadata", value: "foo"}]}
	})
}
-- ellipsis.cue --
nestedEllipsis: minimal: {
	out: #Schema & { extra: "foo" }
	#Schema: {
		#meta
		...
	}
	#meta: {}

	@test(eq, {out: {extra: "foo"}, #Schema: {}, #meta: {}})
}
nestedEllipsis: nestedWithPatterns: {
	out: #Schema & {
		objs: obj1: extra: "foo"
	}
	#Schema: {
		[_]: [_]: {
			#meta
			...
		}
		#meta: name?: int
		objs?: _
	}

	@test(eq, {
		out: {
			objs: {obj1: {extra: "foo", name?: int}}
			#meta: {name?: int}
		}
		#Schema: {#meta: {name?: int}, objs?: {}}
	})
}
// evalv3 "field not allowed" regression with ellipses since v0.13.0; embedding
// a schema with `...` alongside additional fields should not close the struct.
// https://cuelang.org/issue/4015
issue4015: reduced: {
	#X: { ... }
	out: {
		// Embedded schema allows `a: _`. Adding `a` below should not change that.
		#X
		a: b: string
	} @test(allows, string) @test(closed)
	out: {
		a: {
			c: "h"
			b: "x"
		}
	}

	@test(eq, {#X: {}, out: {a: {b: "x", c: "h"}}})
}
issue4015: nested: {
	#X: { foo: {...} }
	out: {
		#X
		foo: {a: b: string} @test(allows, string) @test(closed)
	}
	out: {
		foo: a: {
			c: "h"
			b: "x"
		}
	}

	@test(eq, {#X: {foo: {}}, out: {foo: {a: {b: "x", c: "h"}}}})
}
issue4015: full: {
	#Schema: {
		cfg: {
			foo: {
				enabled:    bool | *false
				fooField: string
			}
			bar: barField: string
		}
		capacity: int | *3
	}

	#MoreCapacity: {
		capacity: 30
		...
	}

	out: #Schema
	out: {
		#MoreCapacity
		cfg: foo: enabled: true
	}
	out: {
		cfg: {
			foo: fooField: "h"
			bar: barField: "x"
		}

		// This one is rather confusing, but true. Note that this should no
		// longer hold if this is converted to the explicitopen semantics, in
		// which case #Schema applies "monotonically" limiting to its fields.
		@test(allows, string)
		@test(allows:todo=false, string, hint="for explicit open")
		@test(closed)
	}

	@test(eq, {
		#Schema: {
			cfg: {
				foo: {enabled: *false | bool, fooField: string}
				bar: {barField: string}
			}
			capacity: *3 | int
		}
		#MoreCapacity: {capacity: 30}
		out: {
			cfg: {foo: {enabled: true, fooField: "h"}, bar: {barField: "x"}}
			capacity: 30
		}
	})
}
-- issue3964.cue --
// evalv3 closedness regression since v0.13.1; a definition that embeds another
// definition containing a disjunction should correctly allow matching fields.
// https://cuelang.org/issue/3964
issue3964: reduced: {
	#Output: { #Embedded }
	#Embedded: {
		name: string
		#Unused | #Used
	}
	#Unused: {}
	#Used: {}

	@test(eq, {
		#Output: {name: string}
		#Embedded: {name: string}
		#Unused: {}
		#Used: {}
	})
}
issue3964: full: {
	out: #Output & {
		name: "oauth2"
		used: "bar"
	}
	#Output: { #Embedded }
	#Embedded: {
		name: string
		#Unused | #Used
	}
	#Unused: unused: string
	#Used: used: string

	@test(eq, {
		out: {name: "oauth2", used: "bar"}
		#Output: {name: string, unused: string} | {name: string, used: string}
		#Embedded: {name: string, unused: string} | {name: string, used: string}
		#Unused: {unused: string}
		#Used: {used: string}
	})
}
-- cycle.cue --
// evalv3 stack overflow due to latest closedness changes; mutually recursive
// definitions that embed each other caused infinite recursion during evaluation.
// https://cuelang.org/issue/4006
issue4006: {
	#A: {
		#B
		fieldA: string
	}
	#B: { #A }
	#C: #A & {}
	out: #C & #B

	@test(eq, {
		#A: {fieldA: string}
		#B: {fieldA: string}
		#C: {fieldA: string}
		out: {fieldA: string}
	})
}
-- out/eval/stats --
Leaks:  77
Freed:  860
Reused: 812
Allocs: 125
Retain: 0

Unifications: 765
Conjuncts:    1528
Disjuncts:    84
Notifications: 7

NumCloseIDs: 441

ConjunctInfos:       1118
MaxConjunctInfos:    5
MaxReqSets:          9
MaxRedirect:         2
-- out/errors.txt --
[eval] issue3947.full.out.disallowed: field not allowed:
    ./disjunction.cue:8:13
[eval] issue3957.reduced.c.a: field not allowed:
    ./disjunction.cue:15:5
    ./disjunction.cue:16:11
[eval] embed.simple.a.err: field not allowed:
    ./in.cue:4:5
[eval] embed.andInStruct.a.err: field not allowed:
    ./in.cue:8:16
[eval] embed.embedDefWithEmbedding.a.err: field not allowed:
    ./in.cue:14:16
[eval] embed.embedComprehension.a.err: field not allowed:
    ./in.cue:20:16
[eval] embed.fieldWithAnd.a.err: field not allowed:
    ./in.cue:26:13
[eval] embed.embedAndRecursive.x.err: field not allowed:
    ./in.cue:33:11
[eval] embed.andEmbed.d.err: field not allowed:
    ./in.cue:41:11
[eval] embed.withIndirect.err: field not allowed:
    ./in.cue:128:8
[eval] embed.normalValidator.x.err: field not allowed:
    ./validators.cue:8:3
    ./validators.cue:13:5
[eval] embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct):
    ./validators.cue:30:16
    ./validators.cue:31:5
    ./validators.cue:31:9
    ./validators.cue:32:5
    ./validators.cue:33:8
embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1:
    ./validators.cue:30:5
    ./validators.cue:30:12
    ./validators.cue:31:9
    ./validators.cue:33:8
[eval] and.transitive.err.out.err: field not allowed:
    ./in.cue:65:3
[eval] and.transitiveWithEmbed.err.out.err: field not allowed:
    ./in.cue:88:3
[incomplete] issue3832.#T._subject.out.outFirstName: undefined field: firstName:
    ./issue3832.cue:12:24
[incomplete] issue3832.#T.results: unresolved disjunction {pass:"never",check!:_} | {pass:{let self#2=_|_(issue3832.#T._assert.pass.self: undefined field: self),outFirstName:_|_(issue3832.#T._assert.pass.outFirstName: undefined field: firstName)},invoke!:_} (type struct):
    ./issue3832.cue:25:12
[incomplete] issue3832._subject.out.outFirstName: undefined field: firstName:
    ./issue3832.cue:12:24
[eval] issue3833.evalv2Issue.out.a.c: field not allowed:
    ./issue3833.cue:29:6
    ./issue3833.cue:31:9
[incomplete] orig.t2.#Output.out: undefined field: input:
    ./issue3858.cue:77:18
[incomplete] full.#Resource.pickMsg.msg: invalid interpolation: non-concrete value string (type string):
    ./large.cue:7:25
    ./large.cue:3:12
[incomplete] full.#JSONPatch.output: cannot reference optional field: namespace:
    ./large.cue:21:24
full.#JSONPatch.output: key value of dynamic field must be concrete, found _|_(full.#JSONPatch.output: cannot reference optional field: namespace):
    ./large.cue:21:24
[incomplete] full.#Main.jsonPatch.output: key value of dynamic field must be concrete, found string:
    ./large.cue:21:24
    ./large.cue:19:15
[incomplete] disjunction.withErr.t1.out.b1: 4 errors in empty disjunction:
disjunction.withErr.t1.out.b1: conflicting values {b2:{b3:params.mayExistLater}} and null (mismatched types struct and null):
    ./validators.cue:39:7
    ./validators.cue:40:7
    ./validators.cue:42:17
disjunction.withErr.t1.out.b1.b2: 2 errors in empty disjunction:
disjunction.withErr.t1.out.b1.b2: conflicting values {b3:params.mayExistLater} and null (mismatched types struct and null):
    ./validators.cue:39:7
    ./validators.cue:40:11
    ./validators.cue:42:24
    ./validators.cue:43:17
disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
    ./validators.cue:40:22
-- out/diff-v2-v3.txt --
Errors differ between v2 and v3 evaluators (v3 reports fewer positions).
Structure sharing differences between v2 and v3.
Verdict: mix -- improvement: v3 uses structure sharing. worsening: v3 reports fewer error positions.
