# Tests that unifying a disjunction of definitions with an additional constraint
# (#a: (#c | #d) & {name: string}) does not incorrectly reject fields from either branch.
# https://cuelang.org/issue/471
-- in.cue --
package x

#a: (#c | #d) & {
	name: string
}

#a1: #c & {
	name: string
}

#a2: #d & {
	name: string
}

#c: {
	name: string
	age:  int
}

#d: {
	name:    string
	address: string
}
-- out/compile --
--- in.cue
{
  #a: ((〈0;#c〉|〈0;#d〉) & {
    name: string
  })
  #a1: (〈0;#c〉 & {
    name: string
  })
  #a2: (〈0;#d〉 & {
    name: string
  })
  #c: {
    name: string
    age: int
  }
  #d: {
    name: string
    address: string
  }
}
