#name: new-style definitions
#evalPartial
-- in.cue --
#Foo: {
	a: 1
	b: int
}
"#Foo": #Foo & {b: 1}

bulk: {[string]: string} & {
	#def: 4 // Different namespace, so bulk option does not apply.
	_hid: 3
	a:    "foo"
}
-- out/def --
"#Foo": #Foo & {
	b: 1
}
#Foo: {
	a: 1
	b: int
}
bulk: {
	{[string]: string}
	a:    "foo"
	#def: 4
	_hid: 3
}
-- out/export --
"#Foo": {
	a: 1
	b: 1
}
bulk: {
	a: "foo"
}
-- out/yaml --
'#Foo':
  a: 1
  b: 1
bulk:
  a: foo
-- out/json --
{"#Foo":{"a":1,"b":1},"bulk":{"a":"foo"}}
-- out/legacy-debug --
<0>{"#Foo": <1>C{a: 1, b: 1}, #Foo: <2>C{a: 1, b: int}, bulk: <3>{[]: <4>(_: string)->string, a: "foo", #def: 4, _hid: 3}}
-- out/compile --
--- in.cue
{
  #Foo: {
    a: 1
    b: int
  }
  "#Foo": (〈0;#Foo〉 & {
    b: 1
  })
  bulk: ({
    [string]: string
  } & {
    #def: 4
    _hid: 3
    a: "foo"
  })
}
-- out/eval/stats --
Leaks:  0
Freed:  11
Reused: 8
Allocs: 3
Retain: 0

Unifications: 11
Conjuncts:    16
Disjuncts:    11
-- out/evalalpha --
(struct){
  #Foo: (#struct){
    a: (int){ 1 }
    b: (int){ int }
  }
  "#Foo": (#struct){
    b: (int){ 1 }
    a: (int){ 1 }
  }
  bulk: (struct){
    #def: (int){ 4 }
    _hid: (int){ 3 }
    a: (string){ "foo" }
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -4,8 +4,8 @@
     b: (int){ int }
   }
   "#Foo": (#struct){
-    a: (int){ 1 }
     b: (int){ 1 }
+    a: (int){ 1 }
   }
   bulk: (struct){
     #def: (int){ 4 }
-- diff/todo/p3 --
Reordering
-- out/eval --
(struct){
  #Foo: (#struct){
    a: (int){ 1 }
    b: (int){ int }
  }
  "#Foo": (#struct){
    a: (int){ 1 }
    b: (int){ 1 }
  }
  bulk: (struct){
    #def: (int){ 4 }
    _hid: (int){ 3 }
    a: (string){ "foo" }
  }
}
