File: issue332.txtar

package info (click to toggle)
golang-github-cue-lang-cue 0.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,644 kB
  • sloc: makefile: 20; sh: 15
file content (64 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- in.cue --
import "list"

#d: {
	#x: string
	result: [#x]
}
#foo: {
	X=#x: _
	y:    list.FlattenN((#d & {#x: X}).result, 1)
}
r: #foo & {
	#x: "hello"
}
-- out/eval/stats --
Leaks:  2
Freed:  19
Reused: 13
Allocs: 8
Retain: 10

Unifications: 21
Conjuncts:    52
Disjuncts:    29
-- out/eval --
(struct){
  #d: (#struct){
    #x: (string){ string }
    result: (#list){
      0: (string){ string }
    }
  }
  #foo: (#struct){
    #x: (_){ _ }
    y: (#list){
      0: (string){ string }
    }
  }
  r: (#struct){
    #x: (string){ "hello" }
    y: (#list){
      0: (string){ "hello" }
    }
  }
}
-- out/compile --
--- in.cue
{
  #d: {
    #x: string
    result: [
      〈1;#x〉,
    ]
  }
  #foo: {
    #x: _
    y: 〈import;list〉.FlattenN((〈1;#d〉 & {
      #x: 〈1;#x〉
    }).result, 1)
  }
  r: (〈0;#foo〉 & {
    #x: "hello"
  })
}