Skip to content

Commit 43ed667

Browse files
committed
internal/core/adt: add test for issue 3819
This was fixed with the new closedness implementation. Closes #3819 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I66d344841d31865054a5a1a9eb45aa70dc036cd0 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211765 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent fd79eff commit 43ed667

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -- evalv2 --
2+
env CUE_EXPERIMENT=evalv3=0
3+
exec cue eval -e output main.cue
4+
cmp stdout stdout.golden
5+
6+
# -- evalv3 --
7+
env CUE_EXPERIMENT=evalv3=1
8+
env CUE_DEBUG=openinline=0
9+
exec cue eval -e output main.cue
10+
cmp stdout stdout.golden
11+
12+
-- cue.mod/module.cue --
13+
module: "example.org/module@v0"
14+
language: {
15+
version: "v0.9.0"
16+
}
17+
-- main.cue --
18+
package main
19+
20+
import (
21+
"example.org/module/a_package"
22+
)
23+
24+
output: a_package.level2
25+
-- a_package/accountconfig.cue --
26+
package a_package
27+
28+
// must be a structure to trigger the panic
29+
#structure: {
30+
f: string
31+
}
32+
#Level0: {
33+
structure?: #structure
34+
}
35+
#Level1: {
36+
#Level0
37+
}
38+
#Level2: {
39+
#Level1
40+
structure?: #structure
41+
if structure != _|_ {
42+
if settings.child != _|_ {
43+
x: "x"
44+
}
45+
}
46+
settings: {
47+
child?: string
48+
}
49+
}
50+
51+
level2: #Level2 & {
52+
structure: {
53+
f: "a"
54+
}
55+
}
56+
-- stdout.golden --
57+
structure: {
58+
f: "a"
59+
}
60+
settings: {}

0 commit comments

Comments
 (0)