Skip to content

Commit e0577bb

Browse files
committed
internal/core/adt: prevent state erasure
This change avoids marking an arc with too high a state prematurely. This is currently not an issue, but will be an issue after the comprehension rework. Isolating this change within a separate CL will help identify unforeseen breakages that are specifically related to this change. Also removed XXX that is now fixed. Change-Id: Id3194aeebd905474adedd3245f15d9cb816c5865 Signed-off-by: Marcel van Lohuizen <mpvl@golang.org> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/529522 Reviewed-by: Paul Jolly <paul@myitcv.io>
1 parent f045a5a commit e0577bb

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

internal/core/adt/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ func (n *nodeContext) addVertexConjuncts(env *Environment, closeInfo CloseInfo,
13911391
// is necessary to prevent lookups in unevaluated structs.
13921392
// TODO(cycles): this can probably most easily be fixed with a
13931393
// having a more recursive implementation.
1394-
n.ctx.Unify(arc, AllArcs)
1394+
n.ctx.Unify(arc, Partial)
13951395
}
13961396

13971397
for _, c := range arc.Conjuncts {

internal/core/export/testdata/adt.txtar

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ p1: [X=string]: name: X
88
d1: "foo\(bar)": int
99
bar: "bar"
1010

11-
// XXX: reference not resolving.
1211
d2: C="foo\(bar)": {
1312
name: "xx"
1413
foo: C.name
@@ -227,8 +226,6 @@ errorListDef: {
227226
[d1 foobar]
228227
[bar]
229228
[d2]
230-
- XXX: reference not resolving.
231-
232229
[d2 foobar]
233230
[d2 foobar name]
234231
[d2 foobar foo]
@@ -309,8 +306,6 @@ _|_ // e3: index out of range [2] with length 2
309306
foobar: int
310307
}
311308
bar: "bar"
312-
313-
// XXX: reference not resolving.
314309
d2: {
315310
foobar: {
316311
name: "xx"

0 commit comments

Comments
 (0)