Skip to content

Commit

Permalink
Ugly workaround for #2566 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bozaro committed Sep 11, 2023
1 parent e40ffb3 commit 4f21370
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
28 changes: 6 additions & 22 deletions cue/testdata/eval/let_funcs.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ foo: {
}
-- out/eval/stats --
Leaks: 0
Freed: 42
Reused: 38
Freed: 26
Reused: 22
Allocs: 4
Retain: 0

Unifications: 42
Conjuncts: 90
Disjuncts: 42
Builtins: 9
Unifications: 26
Conjuncts: 42
Disjuncts: 26
Builtins: 1
-- out/eval --
(struct){
#Foo: (#struct){
Expand All @@ -74,43 +74,27 @@ Builtins: 9
foo: (bool){ false }
}
e1: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e2: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e3: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e4: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e5: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e6: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e7: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
e8: (#struct){
#a: (string){ "hello" }
#b: (string){ "world" }
foo: (bool){ false }
}
}
Expand Down
9 changes: 9 additions & 0 deletions internal/core/adt/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,15 @@ func (n *nodeContext) evalExpr(v Conjunct, state vertexStatus) {
}
v.CloseInfo = ci

if _, ok := x.(*LetReference); ok {
if arc.status == finalized {
if b, ok := arc.BaseValue.(*Bottom); !ok || !b.IsIncomplete() {
n.addExprConjunct(MakeRootConjunct(nil, arc.ToDataAll(n.ctx)), arc.status)
return
}
}
}

n.addVertexConjuncts(v, arc, false)

case Evaluator:
Expand Down

0 comments on commit 4f21370

Please sign in to comment.