#name: template unification within one struct
#evalFull
-- in.cue --
a: {
	{[A=string]: {name: A}}

	// TODO: allow duplicate alias here
	{[X=string]: {kind: X}}
}
a: "A": _
a: "C": _
a: "E": {c: "bar"}
-- out/def --
a: {
	{[A=string]: {
		name: A, kind: A
	}}
	E: {
		name: "E"
		kind: "E"
		c:    "bar"
	}
	A: {
		name: "A"
		kind: "A"
	}
	C: {
		name: "C"
		kind: "C"
	}
}
-- out/export --
a: {
	E: {
		name: "E"
		kind: "E"
		c:    "bar"
	}
	A: {
		name: "A"
		kind: "A"
	}
	C: {
		name: "C"
		kind: "C"
	}
}
-- out/yaml --
a:
  E:
    name: E
    kind: E
    c: bar
  A:
    name: A
    kind: A
  C:
    name: C
    kind: C
-- out/json --
{"a":{"E":{"name":"E","kind":"E","c":"bar"},"A":{"name":"A","kind":"A"},"C":{"name":"C","kind":"C"}}}
-- out/legacy-debug --
<0>{a: <1>{[]: <2>(A: string)->(<3>{name: <2>.A} & <4>{kind: <2>.A}), E: <5>{name: "E", kind: "E", c: "bar"}, A: <6>{name: "A", kind: "A"}, C: <7>{name: "C", kind: "C"}}}
-- out/compile --
--- in.cue
{
  a: {
    {
      [string]: {
        name: 〈1;-〉
      }
    }
    {
      [string]: {
        kind: 〈1;-〉
      }
    }
  }
  a: {
    A: _
  }
  a: {
    C: _
  }
  a: {
    E: {
      c: "bar"
    }
  }
}
-- out/eval/stats --
Leaks:  0
Freed:  12
Reused: 8
Allocs: 4
Retain: 0

Unifications: 12
Conjuncts:    23
Disjuncts:    12
-- out/eval --
(struct){
  a: (struct){
    A: (struct){
      name: (string){ "A" }
      kind: (string){ "A" }
    }
    C: (struct){
      name: (string){ "C" }
      kind: (string){ "C" }
    }
    E: (struct){
      c: (string){ "bar" }
      name: (string){ "E" }
      kind: (string){ "E" }
    }
  }
}
