Skip to content

Commit

Permalink
internal/core/adt: prevent state erasure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mpvl committed Feb 17, 2022
1 parent f045a5a commit e0577bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion internal/core/adt/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ func (n *nodeContext) addVertexConjuncts(env *Environment, closeInfo CloseInfo,
// is necessary to prevent lookups in unevaluated structs.
// TODO(cycles): this can probably most easily be fixed with a
// having a more recursive implementation.
n.ctx.Unify(arc, AllArcs)
n.ctx.Unify(arc, Partial)
}

for _, c := range arc.Conjuncts {
Expand Down
5 changes: 0 additions & 5 deletions internal/core/export/testdata/adt.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ p1: [X=string]: name: X
d1: "foo\(bar)": int
bar: "bar"

// XXX: reference not resolving.
d2: C="foo\(bar)": {
name: "xx"
foo: C.name
Expand Down Expand Up @@ -227,8 +226,6 @@ errorListDef: {
[d1 foobar]
[bar]
[d2]
- XXX: reference not resolving.

[d2 foobar]
[d2 foobar name]
[d2 foobar foo]
Expand Down Expand Up @@ -309,8 +306,6 @@ _|_ // e3: index out of range [2] with length 2
foobar: int
}
bar: "bar"

// XXX: reference not resolving.
d2: {
foobar: {
name: "xx"
Expand Down

0 comments on commit e0577bb

Please sign in to comment.