-- 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/eval/stats --
Leaks:  0
Freed:  20
Reused: 14
Allocs: 6
Retain: 2

Unifications: 18
Conjuncts:    31
Disjuncts:    22
-- out/eval --
(struct){
  #a: (#struct){ |((#struct){
      name: (string){ string }
      age: (int){ int }
    }, (#struct){
      name: (string){ string }
      address: (string){ string }
    }) }
  #a1: (#struct){
    name: (string){ string }
    age: (int){ int }
  }
  #a2: (#struct){
    name: (string){ string }
    address: (string){ string }
  }
  #c: (#struct){
    name: (string){ string }
    age: (int){ int }
  }
  #d: (#struct){
    name: (string){ string }
    address: (string){ 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
  }
}
