...
1-- in.cue --
2import "encoding/yaml"
3
4issue700: {
5 a: y: "y"
6 test1: *a.x | 1
7 test2: *a.y | 1
8}
9
10lookup: {
11 x: {
12 name: "Hello"
13 }
14 y: x.a
15 ok1: *x.a | x
16 ok2: x | *x.a
17 ok3: x.a | *x
18 ok4: *x | x.a
19 ok5: x | x.a
20 ok5: x.a | x
21 allFail1: x.a | x.b
22 allFail2: x.a | x.b
23}
24
25func: {
26 s: string
27 ok1: yaml.MarshalStream(s) | yaml.Marshal(s)
28}
29
30issue782: {
31 a: {
32 inner: string
33 interpolation: *"\(inner)" | string
34 interpolation: "override"
35 }
36 b: {
37 inner: string
38 interpolation: string | *"\(inner)"
39 interpolation: "override"
40 }
41 c: {
42 inner: string
43 interpolation: "\(inner)" | string
44 interpolation: "override"
45 }
46 d: {
47 inner: string
48 interpolation: string | "\(inner)"
49 interpolation: "override"
50 }
51}
52-- out/eval/stats --
53Leaks: 0
54Freed: 70
55Reused: 64
56Allocs: 6
57Retain: 0
58
59Unifications: 40
60Conjuncts: 99
61Disjuncts: 70
62-- out/eval --
63(struct){
64 issue700: (struct){
65 a: (struct){
66 y: (string){ "y" }
67 }
68 test1: (int){ 1 }
69 test2: ((int|string)){ |(*(string){ "y" }, (int){ 1 }) }
70 }
71 lookup: (struct){
72 x: (struct){
73 name: (string){ "Hello" }
74 }
75 y: (_|_){
76 // [incomplete] lookup.y: undefined field: a:
77 // ./in.cue:13:14
78 }
79 ok1: (struct){
80 name: (string){ "Hello" }
81 }
82 ok2: (struct){
83 name: (string){ "Hello" }
84 }
85 ok3: (struct){
86 name: (string){ "Hello" }
87 }
88 ok4: (struct){
89 name: (string){ "Hello" }
90 }
91 ok5: (struct){
92 name: (string){ "Hello" }
93 }
94 allFail1: (_|_){
95 // [incomplete] lookup.allFail1: 2 errors in empty disjunction:
96 // lookup.allFail1: undefined field: a:
97 // ./in.cue:20:14
98 // lookup.allFail1: undefined field: b:
99 // ./in.cue:20:20
100 }
101 allFail2: (_|_){
102 // [incomplete] lookup.allFail2: 2 errors in empty disjunction:
103 // lookup.allFail2: undefined field: a:
104 // ./in.cue:21:14
105 // lookup.allFail2: undefined field: b:
106 // ./in.cue:21:20
107 }
108 }
109 func: (struct){
110 s: (string){ string }
111 ok1: (_|_){
112 // [incomplete] func.ok1: 2 errors in empty disjunction:
113 // func.ok1: non-concrete argument 0:
114 // ./in.cue:26:7
115 // func.ok1: non-concrete argument 0:
116 // ./in.cue:26:31
117 }
118 }
119 issue782: (struct){
120 a: (struct){
121 inner: (string){ string }
122 interpolation: (string){ "override" }
123 }
124 b: (struct){
125 inner: (string){ string }
126 interpolation: (string){ "override" }
127 }
128 c: (struct){
129 inner: (string){ string }
130 interpolation: (string){ "override" }
131 }
132 d: (struct){
133 inner: (string){ string }
134 interpolation: (string){ "override" }
135 }
136 }
137}
138-- out/compile --
139--- in.cue
140{
141 issue700: {
142 a: {
143 y: "y"
144 }
145 test1: (*〈0;a〉.x|1)
146 test2: (*〈0;a〉.y|1)
147 }
148 lookup: {
149 x: {
150 name: "Hello"
151 }
152 y: 〈0;x〉.a
153 ok1: (*〈0;x〉.a|〈0;x〉)
154 ok2: (〈0;x〉|*〈0;x〉.a)
155 ok3: (〈0;x〉.a|*〈0;x〉)
156 ok4: (*〈0;x〉|〈0;x〉.a)
157 ok5: (〈0;x〉|〈0;x〉.a)
158 ok5: (〈0;x〉.a|〈0;x〉)
159 allFail1: (〈0;x〉.a|〈0;x〉.b)
160 allFail2: (〈0;x〉.a|〈0;x〉.b)
161 }
162 func: {
163 s: string
164 ok1: (〈import;"encoding/yaml"〉.MarshalStream(〈0;s〉)|〈import;"encoding/yaml"〉.Marshal(〈0;s〉))
165 }
166 issue782: {
167 a: {
168 inner: string
169 interpolation: (*"\(〈0;inner〉)"|string)
170 interpolation: "override"
171 }
172 b: {
173 inner: string
174 interpolation: (string|*"\(〈0;inner〉)")
175 interpolation: "override"
176 }
177 c: {
178 inner: string
179 interpolation: ("\(〈0;inner〉)"|string)
180 interpolation: "override"
181 }
182 d: {
183 inner: string
184 interpolation: (string|"\(〈0;inner〉)")
185 interpolation: "override"
186 }
187 }
188}
View as plain text