cuelang.org/go@v0.13.0/cue/testdata/definitions/036_optionals_in_open_structs.txtar (about) 1 #name: optionals in open structs 2 #evalFull 3 -- in.cue -- 4 A: { 5 [=~"^[a-s]*$"]: int 6 } 7 B: { 8 [=~"^[m-z]*$"]: int 9 } 10 #C: {A & B} 11 c: #C & {aaa: 3} 12 -- out/def -- 13 A: { 14 [=~"^[a-s]*$"]: int 15 } 16 B: { 17 [=~"^[m-z]*$"]: int 18 } 19 #C: { 20 A & B 21 } 22 c: #C & { 23 aaa: 3 24 } 25 -- out/export -- 26 A: {} 27 B: {} 28 c: { 29 aaa: 3 30 } 31 -- out/yaml -- 32 A: {} 33 B: {} 34 c: 35 aaa: 3 36 -- out/json -- 37 {"A":{},"B":{},"c":{"aaa":3}} 38 -- out/legacy-debug -- 39 <0>{A: <1>{[=~"^[a-s]*$"]: <2>(_: string)->int, }, B: <3>{[=~"^[m-z]*$"]: <4>(_: string)->int, }, #C: <5>C{[=~"^[a-s]*$"]: <6>(_: string)->int, [=~"^[m-z]*$"]: <7>(_: string)->int, }, c: <8>C{[=~"^[a-s]*$"]: <9>(_: string)->int, [=~"^[m-z]*$"]: <10>(_: string)->int, aaa: 3}} 40 -- out/compile -- 41 --- in.cue 42 { 43 A: { 44 [=~"^[a-s]*$"]: int 45 } 46 B: { 47 [=~"^[m-z]*$"]: int 48 } 49 #C: { 50 (〈1;A〉 & 〈1;B〉) 51 } 52 c: (〈0;#C〉 & { 53 aaa: 3 54 }) 55 } 56 -- out/eval/stats -- 57 Leaks: 0 58 Freed: 6 59 Reused: 3 60 Allocs: 3 61 Retain: 0 62 63 Unifications: 6 64 Conjuncts: 17 65 Disjuncts: 6 66 -- out/eval -- 67 (struct){ 68 A: (struct){ 69 } 70 B: (struct){ 71 } 72 #C: (#struct){ 73 } 74 c: (#struct){ 75 aaa: (int){ 3 } 76 } 77 }