File tree Expand file tree Collapse file tree 1 file changed +97
-7
lines changed Expand file tree Collapse file tree 1 file changed +97
-7
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,29 @@ issue3541: {
54
54
val.num + val.test
55
55
}])
56
56
}
57
+
58
+ issue2594: sumFirst: {
59
+ #Def: {
60
+ number & list.Sum(#In)
61
+ #In: [...number]
62
+ }
63
+
64
+ x!: 6
65
+ x: #Def & {_
66
+ #In: [1, 2, 3]
67
+ }
68
+ }
69
+ issue2594: sumSecond: {
70
+ #Def: {
71
+ #In: [...number]
72
+ number & list.Sum(#In)
73
+ }
74
+
75
+ x!: 6
76
+ x: #Def & {_
77
+ #In: [1, 2, 3]
78
+ }
79
+ }
57
80
-- out/list-v3 --
58
81
Errors:
59
82
0: invalid operands 2 and {num:6} to '+' (type int and struct):
@@ -85,30 +108,78 @@ issue1404: {
85
108
sum: 1
86
109
}
87
110
issue3541: _|_ // 0: invalid operands 2 and {num:6} to '+' (type int and struct)
111
+ issue2594: {
112
+ sumFirst: {
113
+ #Def: {
114
+ 0
115
+ #In: [...number]
116
+ }
117
+ x: {
118
+ 6
119
+ #In: [1, 2, 3]
120
+ }
121
+ }
122
+ sumSecond: {
123
+ #Def: {
124
+ 0
125
+ #In: [...number]
126
+ }
127
+ x: {
128
+ 6
129
+ #In: [1, 2, 3]
130
+ }
131
+ }
132
+ }
88
133
-- diff/-out/list-v3<==>+out/list --
89
134
diff old new
90
135
--- old
91
136
+++ new
92
- @@ -1,3 +1,10 @@
93
- +Errors:
137
+ @@ -1,9 +1,8 @@
138
+ Errors:
139
+ -issue2594.sumSecond.x: conflicting values 0 and 6:
140
+ - ./in.cue:71:3
141
+ - ./in.cue:71:12
142
+ - ./in.cue:74:6
143
+ - ./in.cue:75:6
94
144
+0: invalid operands 2 and {num:6} to '+' (type int and struct):
95
145
+ ./in.cue:53:3
96
146
+ ./in.cue:35:9
97
147
+ ./in.cue:36:10
98
- +
99
- + Result:
148
+
149
+ Result:
100
150
issue563: {
101
- #MyDef: {
102
- name: string
103
- @@ -20,4 +27,4 @@
151
+ @@ -28,7 +27,7 @@
104
152
a: *1 | 2
105
153
sum: 1
106
154
}
107
155
-issue3541: {}
108
156
+issue3541: _|_ // 0: invalid operands 2 and {num:6} to '+' (type int and struct)
157
+ issue2594: {
158
+ sumFirst: {
159
+ #Def: {
160
+ @@ -45,6 +44,9 @@
161
+ 0
162
+ #In: [...number]
163
+ }
164
+ - x: _|_ // issue2594.sumSecond.x: conflicting values 0 and 6
165
+ + x: {
166
+ + 6
167
+ + #In: [1, 2, 3]
168
+ + }
169
+ }
170
+ }
109
171
-- diff/explanation --
110
172
issue3541: evalv3 correctly spots an invalid operand error which evalv2 drops on the floor.
173
+ issue2594: evalv3 fixes an ordering issue present in evalv2.
111
174
-- out/list --
175
+ Errors:
176
+ issue2594.sumSecond.x: conflicting values 0 and 6:
177
+ ./in.cue:71:3
178
+ ./in.cue:71:12
179
+ ./in.cue:74:6
180
+ ./in.cue:75:6
181
+
182
+ Result:
112
183
issue563: {
113
184
#MyDef: {
114
185
name: string
@@ -132,3 +203,22 @@ issue1404: {
132
203
sum: 1
133
204
}
134
205
issue3541: {}
206
+ issue2594: {
207
+ sumFirst: {
208
+ #Def: {
209
+ 0
210
+ #In: [...number]
211
+ }
212
+ x: {
213
+ 6
214
+ #In: [1, 2, 3]
215
+ }
216
+ }
217
+ sumSecond: {
218
+ #Def: {
219
+ 0
220
+ #In: [...number]
221
+ }
222
+ x: _|_ // issue2594.sumSecond.x: conflicting values 0 and 6
223
+ }
224
+ }
You can’t perform that action at this time.
0 commit comments