Skip to content

Commit 5905c22

Browse files
committed
internal/core/eval: verify issue 332 is fixed
Fixes #332 Change-Id: Id4b479cf6b0457124d2ea837bc0a879a2f598729 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6945 Reviewed-by: CUE cueckoo <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 541bf03 commit 5905c22

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- in.cue --
2+
import "list"
3+
#d: {
4+
#x: string
5+
result: [#x]
6+
}
7+
#foo: {
8+
X=#x: _
9+
y: list.FlattenN((#d & {#x: X}).result, 1)
10+
}
11+
r: #foo & {
12+
#x: "hello"
13+
}
14+
-- out/eval --
15+
(struct){
16+
#d: (#struct){
17+
#x: (string){ string }
18+
result: (#list){
19+
0: (string){ string }
20+
}
21+
}
22+
#foo: (#struct){
23+
#x: (_){ _ }
24+
y: (#list){
25+
0: (string){ string }
26+
}
27+
}
28+
r: (#struct){
29+
#x: (string){ "hello" }
30+
y: (#list){
31+
0: (string){ "hello" }
32+
}
33+
}
34+
}
35+
-- out/compile --
36+
--- in.cue
37+
{
38+
#d: {
39+
#x: string
40+
result: [
41+
〈0;#x〉,
42+
]
43+
}
44+
#foo: {
45+
#x: _
46+
y: 〈import;list〉.FlattenN((〈1;#d〉 & {
47+
#x: 〈1;#x〉
48+
}).result, 1)
49+
}
50+
r: (〈0;#foo〉 & {
51+
#x: "hello"
52+
})
53+
}

0 commit comments

Comments
 (0)