Skip to content

Commit

Permalink
internal/core/export: document bug in export
Browse files Browse the repository at this point in the history
This records a bug in the SelfContained logic that was
exposed developing eval V3. It fails for all versions, though.

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ia6a92a8bda41e58195abffbaf6f74416caa5cab8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202232
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mpvl committed Oct 8, 2024
1 parent b44f5e0 commit 2eedbd1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/core/export/self_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func TestSelfContained(t *testing.T) {

ToDo: map[string]string{
"self-v3/selfcontained/import": `wa: reference "_hidden_567475F3" not found:`,

"self/selfcontained/cyclic": `reference not properly substituted`,
"self-v3/selfcontained/cyclic": `reference not properly substituted`,
"self-v3-noshare/selfcontained/cyclic": `reference not properly substituted`,
},
}

Expand Down
20 changes: 20 additions & 0 deletions internal/core/export/testdata/selfcontained/cyclic.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#path: a.b.#def

The trick here is that we hoist values that are both cyclic as well as a
definition. The behavior of the definition should be retained, and the
cyclic references should be substituted accordingly.
-- in.cue --
a: b: #def: {
opt?: #def

list: [...#def]
}
-- out/self/default --
X.#def

let X = {
#def: {
opt?: #def
list: [...#def]
}
}

0 comments on commit 2eedbd1

Please sign in to comment.