-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: evaluate nodes that are otherwise not evaluated
With structure sharing, nodes were only sometimes evaluated, assuming that the shared node will be eventually evaluated. This is not always the case, however, for instance when a shared structure refers to a part of a package that is otherwise not evaluated. We now ensure that a shared node is _always_ finalized. Sometimes, like when a node is on an optional path, we cannot currently evaluate it on the part of the stack that would cause a direct structural cycle to be detected. We can eventually find something better, but for now we just record the node to be evaluated at the top of the stack. Fixes #3511 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Iea4ca59e7b45cd75edcb6ccf2afe1cd68556c838 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202814 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
4 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
env CUE_EXPERIMENT=evalv3=1 | ||
exec cue export | ||
cmp stdout out/stdout | ||
|
||
-- cue.mod/module.cue -- | ||
module: "module.test/foo" | ||
language: version: "v0.9.0" | ||
|
||
-- main.cue -- | ||
package p | ||
|
||
import "module.test/foo/imported@v0" | ||
|
||
items: [imported.List] | ||
-- imported/imported.cue -- | ||
package imported | ||
|
||
Namespace: "default" | ||
|
||
List: [...{namespace: Namespace}] | ||
|
||
List: [{name: "kube-api-server"}] | ||
-- out/stdout -- | ||
{ | ||
"items": [ | ||
[ | ||
{ | ||
"name": "kube-api-server", | ||
"namespace": "default" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters