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