cuelang.org/go@v0.13.0/cue/testdata/resolve/039_reference_to_root.txtar (about) 1 #name: reference to root 2 #evalPartial 3 -- in.cue -- 4 a: {b: int} 5 c: a & { 6 b: 100 7 d: a.b + 3 // do not resolve as c != a. 8 } 9 x: { 10 b: int 11 c: b + 5 12 } 13 y: x & { 14 b: 100 15 // c should resolve to 105 16 } 17 v: { 18 b: int 19 c: v.b + 5 // reference starting from copied node. 20 } 21 w: v & {b: 100} 22 wp: v & {b: 100} 23 -- out/def -- 24 x: { 25 b: int 26 c: b + 5 27 } 28 y: x & { 29 b: 100 30 } 31 a: { 32 b: int 33 } 34 c: a & { 35 b: 100 36 d: a.b + 3 37 } 38 v: { 39 b: int 40 c: v.b + 5 41 } 42 w: v & { 43 b: 100 44 } 45 wp: v & { 46 b: 100 47 } 48 -- out/legacy-debug -- 49 <0>{x: <1>{b: int, c: (<2>.b + 5)}, y: <3>{b: 100, c: 105}, a: <4>{b: int}, c: <5>{b: 100, d: (<6>.a.b + 3)}, v: <7>{b: int, c: (<6>.v.b + 5)}, w: <8>{b: 100, c: (<6>.v.b + 5)}, wp: <9>{b: 100, c: (<6>.v.b + 5)}} 50 -- out/compile -- 51 --- in.cue 52 { 53 a: { 54 b: int 55 } 56 c: (〈0;a〉 & { 57 b: 100 58 d: (〈1;a〉.b + 3) 59 }) 60 x: { 61 b: int 62 c: (〈0;b〉 + 5) 63 } 64 y: (〈0;x〉 & { 65 b: 100 66 }) 67 v: { 68 b: int 69 c: (〈1;v〉.b + 5) 70 } 71 w: (〈0;v〉 & { 72 b: 100 73 }) 74 wp: (〈0;v〉 & { 75 b: 100 76 }) 77 } 78 -- out/eval/stats -- 79 Leaks: 0 80 Freed: 21 81 Reused: 18 82 Allocs: 3 83 Retain: 0 84 85 Unifications: 21 86 Conjuncts: 53 87 Disjuncts: 21 88 -- out/eval -- 89 (struct){ 90 a: (struct){ 91 b: (int){ int } 92 } 93 c: (struct){ 94 b: (int){ 100 } 95 d: (_|_){ 96 // [incomplete] c.d: non-concrete value int in operand to +: 97 // ./in.cue:4:5 98 // ./in.cue:1:8 99 } 100 } 101 x: (struct){ 102 b: (int){ int } 103 c: (_|_){ 104 // [incomplete] x.c: non-concrete value int in operand to +: 105 // ./in.cue:8:5 106 // ./in.cue:7:5 107 } 108 } 109 y: (struct){ 110 b: (int){ 100 } 111 c: (int){ 105 } 112 } 113 v: (struct){ 114 b: (int){ int } 115 c: (_|_){ 116 // [incomplete] v.c: non-concrete value int in operand to +: 117 // ./in.cue:16:5 118 // ./in.cue:15:5 119 } 120 } 121 w: (struct){ 122 b: (int){ 100 } 123 c: (_|_){ 124 // [incomplete] w.c: non-concrete value int in operand to +: 125 // ./in.cue:16:5 126 // ./in.cue:15:5 127 } 128 } 129 wp: (struct){ 130 b: (int){ 100 } 131 c: (_|_){ 132 // [incomplete] wp.c: non-concrete value int in operand to +: 133 // ./in.cue:16:5 134 // ./in.cue:15:5 135 } 136 } 137 }