cuelang.org/go@v0.10.1/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar (about) 1 # DO NOT EDIT; generated by go run testdata/gen.go 2 # 3 #name: json Marshaling detects incomplete 4 #evalFull 5 -- in.cue -- 6 import "encoding/json" 7 8 a: json.Marshal({a: string}) 9 10 foo: {a: 3, b: foo.c} 11 b: json.Marshal(foo) 12 -- out/def -- 13 import "encoding/json" 14 15 a: json.Marshal({ 16 a: string 17 }) 18 foo: { 19 a: 3 20 b: foo.c 21 } 22 b: json.Marshal(foo) 23 -- out/legacy-debug -- 24 <0>{a: <1>.Marshal (<2>{a: string}), foo: <3>{a: 3, b: <4>.foo.c}, b: <1>.Marshal (<4>.foo)} 25 -- out/eval/stats -- 26 Leaks: 0 27 Freed: 16 28 Reused: 12 29 Allocs: 4 30 Retain: 5 31 32 Unifications: 16 33 Conjuncts: 24 34 Disjuncts: 21 35 -- out/eval -- 36 (struct){ 37 a: (_|_){ 38 // [incomplete] cannot convert incomplete value "string" to JSON: 39 // ./in.cue:3:21 40 } 41 foo: (struct){ 42 a: (int){ 3 } 43 b: (_|_){ 44 // [incomplete] foo.b: undefined field: c: 45 // ./in.cue:5:20 46 } 47 } 48 b: (_|_){ 49 // [incomplete] foo.b: undefined field: c: 50 // ./in.cue:5:20 51 } 52 } 53 -- out/compile -- 54 --- in.cue 55 { 56 a: 〈import;"encoding/json"〉.Marshal({ 57 a: string 58 }) 59 foo: { 60 a: 3 61 b: 〈1;foo〉.c 62 } 63 b: 〈import;"encoding/json"〉.Marshal(〈0;foo〉) 64 }