# Tests that a struct with an open pattern constraint unifies correctly with a
# definition and an embed, producing the expected closed result. Issue: evalv3
# incorrectly reported "field not allowed" for `y.f` when the struct was opened
# via a pattern constraint `[string]: _` and then closed through unification
# with a definition.
# https://cuelang.org/issue/3813
-- x.cue --
x: {[string]: _}
x: #d
#d: f: _

y: {
	x
}
y: f: true
-- out/compile --
--- x.cue
{
  x: {
    [string]: _
  }
  x: 〈0;#d〉
  #d: {
    f: _
  }
  y: {
    〈1;x〉
  }
  y: {
    f: true
  }
}
