cuelang.org/go@v0.13.0/cue/testdata/disjunctions/resolve.txtar (about) 1 // Ensure that references are resolved on the boundaries of disjunctions. 2 -- in.cue -- 3 resolveAcrossDisjunct: t1: { 4 {} | { #B: 1} // d resolves to 1 in the second case. 5 {d: #B} | {} 6 #B: int 7 } 8 resolveAcrossDisjunct: nested: { 9 {} | { a: b: #B: 1} // d resolves to 1 in the second case. 10 {d: a.b.#B} | {} 11 a: b: #B: int 12 } 13 -- out/evalalpha/stats -- 14 Leaks: 48 15 Freed: 0 16 Reused: 0 17 Allocs: 48 18 Retain: 0 19 20 Unifications: 12 21 Conjuncts: 33 22 Disjuncts: 12 23 24 CloseIDElems: 0 25 NumCloseIDs: 2 26 -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 27 diff old new 28 --- old 29 +++ new 30 @@ -1,9 +1,12 @@ 31 -Leaks: 0 32 -Freed: 44 33 -Reused: 32 34 -Allocs: 12 35 +Leaks: 48 36 +Freed: 0 37 +Reused: 0 38 +Allocs: 48 39 Retain: 0 40 41 -Unifications: 32 42 -Conjuncts: 67 43 -Disjuncts: 44 44 +Unifications: 12 45 +Conjuncts: 33 46 +Disjuncts: 12 47 + 48 +CloseIDElems: 0 49 +NumCloseIDs: 2 50 -- out/eval/stats -- 51 Leaks: 0 52 Freed: 44 53 Reused: 32 54 Allocs: 12 55 Retain: 0 56 57 Unifications: 32 58 Conjuncts: 67 59 Disjuncts: 44 60 -- out/eval -- 61 (struct){ 62 resolveAcrossDisjunct: (struct){ 63 t1: (struct){ |((struct){ 64 #B: (int){ int } 65 d: (int){ int } 66 }, (struct){ 67 #B: (int){ int } 68 }, (struct){ 69 #B: (int){ 1 } 70 d: (int){ 1 } 71 }, (struct){ 72 #B: (int){ 1 } 73 }) } 74 nested: (struct){ |((struct){ 75 a: (struct){ 76 b: (struct){ 77 #B: (int){ int } 78 } 79 } 80 d: (int){ int } 81 }, (struct){ 82 a: (struct){ 83 b: (struct){ 84 #B: (int){ int } 85 } 86 } 87 }, (struct){ 88 a: (struct){ 89 b: (struct){ 90 #B: (int){ 1 } 91 } 92 } 93 d: (int){ 1 } 94 }, (struct){ 95 a: (struct){ 96 b: (struct){ 97 #B: (int){ 1 } 98 } 99 } 100 }) } 101 } 102 } 103 -- out/compile -- 104 --- in.cue 105 { 106 resolveAcrossDisjunct: { 107 t1: { 108 ({}|{ 109 #B: 1 110 }) 111 ({ 112 d: ć1;#Bć 113 }|{}) 114 #B: int 115 } 116 } 117 resolveAcrossDisjunct: { 118 nested: { 119 ({}|{ 120 a: { 121 b: { 122 #B: 1 123 } 124 } 125 }) 126 ({ 127 d: ć1;ać.b.#B 128 }|{}) 129 a: { 130 b: { 131 #B: int 132 } 133 } 134 } 135 } 136 }