#name: json Marshaling detects incomplete
#evalFull
-- in.cue --
import "encoding/json"

a: json.Marshal({a: string})

foo: {a: 3, b: foo.c}
b: json.Marshal(foo)
-- out/def --
import "encoding/json"

a: json.Marshal({
	a: string
})
foo: {
	a: 3
	b: foo.c
}
b: json.Marshal(foo)
-- out/legacy-debug --
<0>{a: <1>.Marshal (<2>{a: string}), foo: <3>{a: 3, b: <4>.foo.c}, b: <1>.Marshal (<4>.foo)}
-- out/evalalpha/stats --
Leaks:  8
Freed:  0
Reused: 0
Allocs: 8
Retain: 0

Unifications: 8
Conjuncts:    8
Disjuncts:    0
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
diff old new
--- old
+++ new
@@ -1,9 +1,9 @@
-Leaks:  0
-Freed:  16
-Reused: 12
-Allocs: 4
-Retain: 5
+Leaks:  8
+Freed:  0
+Reused: 0
+Allocs: 8
+Retain: 0
 
-Unifications: 16
-Conjuncts:    24
-Disjuncts:    21
+Unifications: 8
+Conjuncts:    8
+Disjuncts:    0
-- out/eval/stats --
Leaks:  0
Freed:  16
Reused: 12
Allocs: 4
Retain: 5

Unifications: 16
Conjuncts:    24
Disjuncts:    21
-- out/eval --
(struct){
  a: (_|_){
    // [incomplete] cannot convert incomplete value "string" to JSON:
    //     ./in.cue:3:21
  }
  foo: (struct){
    a: (int){ 3 }
    b: (_|_){
      // [incomplete] foo.b: undefined field: c:
      //     ./in.cue:5:20
    }
  }
  b: (_|_){
    // [incomplete] foo.b: undefined field: c:
    //     ./in.cue:5:20
  }
}
-- out/compile --
--- in.cue
{
  a: 〈import;"encoding/json"〉.Marshal({
    a: string
  })
  foo: {
    a: 3
    b: 〈1;foo〉.c
  }
  b: 〈import;"encoding/json"〉.Marshal(〈0;foo〉)
}
