this repo has no description
0
fork

Configure Feed

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

internal/core/adt: partial revert of fixes for 3919

We removed a piece of code which seemingly
was redundant after the fix for 3919. It turns
out, though, that it is still necessary in some
cases. Reverting it did not affect the results
of 3919 except one change in an error message,
which is now what it was before the change
for 3919.

Issue #3919
Fixes #3931

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

+22 -71
+5 -8
cue/testdata/eval/comprehensions.txtar
··· 271 271 // [eval] issue3691.structuralCycle.a.b.c: conflicting values string and {[string]:X} (mismatched types string and struct): 272 272 // ./issue3691.cue:14:15 273 273 // ./issue3691.cue:15:5 274 - b*: (_|_){// [e]if true { 275 - // c: 〈3;a〉 276 - // }[e] & 〈1;X〉 274 + b: (_|_){ 275 + // [cycle] cycle error 277 276 } 278 277 } 279 278 } ··· 308 307 // ./issue3691.cue:8:10 309 308 } 310 309 } 311 - @@ -145,13 +140,9 @@ 310 + @@ -145,13 +140,8 @@ 312 311 // [eval] issue3691.structuralCycle.a.b.c: conflicting values string and {[string]:X} (mismatched types string and struct): 313 312 // ./issue3691.cue:14:15 314 313 // ./issue3691.cue:15:5 315 314 - // ./issue3691.cue:17:3 316 315 - // ./issue3691.cue:18:10 317 - - b: (_|_){ 316 + b: (_|_){ 318 317 - // [structural cycle] 319 318 - c: (_|_){ 320 319 - // [structural cycle] issue3691.structuralCycle.a.b.c.b.c: structural cycle 321 320 - } 322 - + b*: (_|_){// [e]if true { 323 - + // c: 〈3;a〉 324 - + // }[e] & 〈1;X〉 321 + + // [cycle] cycle error 325 322 } 326 323 } 327 324 }
+12 -63
cue/testdata/eval/issue3919.txtar
··· 64 64 Conjuncts: 73 65 65 Disjuncts: 54 66 66 -- out/evalalpha -- 67 - Errors: 68 - issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 69 - ./let.cue:8:14 70 - 71 - Result: 72 - (_|_){ 73 - // [eval] 67 + (struct){ 74 68 full: (struct){ 75 69 out: (struct){ 76 70 env: (struct){ ··· 83 77 a: (int){ 30080 } 84 78 port: (int){ |(*(int){ 30080 }, (int){ int }) } 85 79 } 86 - issue3931: (_|_){ 87 - // [eval] 88 - full: (_|_){ 89 - // [eval] 90 - bar: (_|_){ 91 - // [eval] 92 - bar1: (_|_){ 93 - // [eval] 94 - spec: (_|_){ 95 - // [eval] 96 - selector: (_|_){ 97 - // [eval] issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 98 - // ./let.cue:8:14 80 + issue3931: (struct){ 81 + full: (struct){ 82 + bar: (struct){ 83 + bar1: (struct){ 84 + spec: (struct){ 85 + selector: (struct){ 86 + label: (string){ "foo" } 87 + expr?: (list){ 88 + } 99 89 } 100 90 } 101 91 } ··· 156 146 diff old new 157 147 --- old 158 148 +++ new 159 - @@ -1,4 +1,10 @@ 160 - -(struct){ 161 - +Errors: 162 - +issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 163 - + ./let.cue:8:14 164 - + 165 - +Result: 166 - +(_|_){ 167 - + // [eval] 168 - full: (struct){ 169 - out: (struct){ 170 - env: (struct){ 171 - @@ -11,15 +17,19 @@ 172 - a: (int){ 30080 } 173 - port: (int){ |(*(int){ 30080 }, (int){ int }) } 174 - } 175 - - issue3931: (struct){ 176 - - full: (struct){ 177 - - bar: (struct){ 178 - - bar1: (struct){ 179 - - spec: (struct){ 180 - - selector: (struct){ 181 - - label: (string){ "foo" } 182 - - expr?: (list){ 183 - - } 184 - + issue3931: (_|_){ 185 - + // [eval] 186 - + full: (_|_){ 187 - + // [eval] 188 - + bar: (_|_){ 189 - + // [eval] 190 - + bar1: (_|_){ 191 - + // [eval] 192 - + spec: (_|_){ 193 - + // [eval] 194 - + selector: (_|_){ 195 - + // [eval] issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 196 - + // ./let.cue:8:14 197 - } 198 - } 199 - } 200 - @@ -45,10 +55,7 @@ 149 + @@ -45,10 +45,7 @@ 201 150 foo: (struct){ 202 151 fooData: (struct){ 203 152 total: (struct){ ··· 209 158 } 210 159 _hidden: (struct){ 211 160 extra: (struct){ 212 - @@ -56,12 +63,7 @@ 161 + @@ -56,12 +53,7 @@ 213 162 } 214 163 } 215 164 shared: (struct){
+5
internal/core/adt/unify.go
··· 215 215 // forcefully do an early recursive evaluation to decide the state 216 216 // of the arc. See https://cuelang.org/issue/3621. 217 217 n.process(pendingKnown, yield) 218 + if n.node.ArcType == ArcPending { 219 + for _, a := range n.node.Arcs { 220 + a.unify(c, needs, attemptOnly, checkTypos) 221 + } 222 + } 218 223 n.completePending(yield) 219 224 } 220 225