this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add test case for order of resolution

This bug was exposed with new closedness, even
though it existed before but apparently with lesser
consequences.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ia90fcc800e021e057e90954a8dc01767620d1d9a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211562
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+58 -9
+58 -9
cue/testdata/definitions/defembed.txtar
··· 6 6 a: c: 1 7 7 8 8 #A: b: 1 9 + 10 + b: { 11 + #A 12 + leaf: "leaf value" 13 + interpolation: "more \(leaf_ref)" 14 + leaf_ref: leaf 15 + } 9 16 -- out/eval/stats -- 10 17 Leaks: 0 11 - Freed: 6 12 - Reused: 2 18 + Freed: 11 19 + Reused: 7 13 20 Allocs: 4 14 - Retain: 1 21 + Retain: 2 15 22 16 - Unifications: 6 17 - Conjuncts: 9 18 - Disjuncts: 7 23 + Unifications: 11 24 + Conjuncts: 17 25 + Disjuncts: 13 19 26 -- out/evalalpha -- 20 27 Errors: 21 28 a.c: field not allowed: 22 29 ./in.cue:5:4 30 + b.leaf_ref: field not allowed: 31 + ./in.cue:13:5 23 32 24 33 Result: 25 34 (_|_){ ··· 35 44 #A: (#struct){ 36 45 b: (int){ 1 } 37 46 } 47 + b: (_|_){ 48 + // [eval] 49 + leaf: (string){ "leaf value" } 50 + interpolation: (string){ "more leaf value" } 51 + leaf_ref: (_|_){ 52 + // [eval] b.leaf_ref: field not allowed: 53 + // ./in.cue:13:5 54 + } 55 + b: (int){ 1 } 56 + } 38 57 } 39 58 -- diff/-out/evalalpha<==>+out/eval -- 40 59 diff old new 41 60 --- old 42 61 +++ new 43 - @@ -1,9 +1,6 @@ 62 + @@ -1,9 +1,8 @@ 44 63 Errors: 45 64 a.c: field not allowed: 46 65 - ./in.cue:1:4 47 66 - ./in.cue:2:2 48 67 ./in.cue:5:4 49 68 - ./in.cue:7:5 69 + +b.leaf_ref: field not allowed: 70 + + ./in.cue:13:5 50 71 51 72 Result: 52 73 (_|_){ 53 - @@ -10,14 +7,11 @@ 74 + @@ -10,22 +9,23 @@ 54 75 // [eval] 55 76 a: (_|_){ 56 77 // [eval] ··· 61 82 - // ./in.cue:2:2 62 83 // ./in.cue:5:4 63 84 - // ./in.cue:7:5 64 - } 85 + - } 86 + + } 65 87 + b: (int){ 1 } 66 88 } 67 89 #A: (#struct){ 68 90 b: (int){ 1 } 91 + } 92 + - b: (#struct){ 93 + - b: (int){ 1 } 94 + + b: (_|_){ 95 + + // [eval] 96 + leaf: (string){ "leaf value" } 97 + interpolation: (string){ "more leaf value" } 98 + - leaf_ref: (string){ "leaf value" } 99 + + leaf_ref: (_|_){ 100 + + // [eval] b.leaf_ref: field not allowed: 101 + + // ./in.cue:13:5 102 + + } 103 + + b: (int){ 1 } 104 + } 105 + } 69 106 -- diff/todo/p2 -- 70 107 Missing positions / reordering. 71 108 -- out/eval -- ··· 93 130 #A: (#struct){ 94 131 b: (int){ 1 } 95 132 } 133 + b: (#struct){ 134 + b: (int){ 1 } 135 + leaf: (string){ "leaf value" } 136 + interpolation: (string){ "more leaf value" } 137 + leaf_ref: (string){ "leaf value" } 138 + } 96 139 } 97 140 -- out/compile -- 98 141 --- in.cue ··· 105 148 } 106 149 #A: { 107 150 b: 1 151 + } 152 + b: { 153 + 〈1;#A〉 154 + leaf: "leaf value" 155 + interpolation: "more \(〈0;leaf_ref〉)" 156 + leaf_ref: 〈0;leaf〉 108 157 } 109 158 }