github.com/solo-io/cue@v0.4.7/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 -- 26 (struct){ 27 a: (_|_){ 28 // [incomplete] cannot convert incomplete value "string" to JSON 29 } 30 foo: (struct){ 31 a: (int){ 3 } 32 b: (_|_){ 33 // [incomplete] foo.b: undefined field: c: 34 // ./in.cue:5:20 35 } 36 } 37 b: (_|_){ 38 // [incomplete] foo.b: undefined field: c: 39 // ./in.cue:5:20 40 } 41 } 42 -- out/compile -- 43 --- in.cue 44 { 45 a: 〈import;"encoding/json"〉.Marshal({ 46 a: string 47 }) 48 foo: { 49 a: 3 50 b: 〈1;foo〉.c 51 } 52 b: 〈import;"encoding/json"〉.Marshal(〈0;foo〉) 53 }