
# Tests that "field not allowed" errors in closed structs include sufficient
# diagnostic information about the source of the restriction.
# https://cuelang.org/issue/320
-- in.cue --
#Foo: {
	x: string
	#More
}

#More: [=~"^x-"]: _

foo: #Foo & {
	x: "hello"
	y: "goodbye"
}
-- out/compile --
--- in.cue
{
  #Foo: {
    x: string
    〈1;#More〉
  }
  #More: {
    [=~"^x-"]: _
  }
  foo: (〈0;#Foo〉 & {
    x: "hello"
    y: "goodbye"
  })
}
