@@ -42,6 +42,22 @@ s23e: >0.0 & <2.0 // no simplification
42
42
43
43
s30: >0 & int
44
44
45
+ floats: {
46
+ [string]: float
47
+ f1: <10.0 & <=5.0
48
+ f2: <=10.0 & <5.0
49
+ f3: <1.1 & <=1.1
50
+ f4: <=1.1 & <=1.1
51
+ f5: >1.1 & >=1.1
52
+ f6: >=1.1 & >1.1
53
+ f7: >=1.1 & <=1.1
54
+
55
+ issue1310: >=2.1 & <=1.0
56
+ fe2: >2.1 & <=2.1
57
+
58
+ fe3: float & >2 & <=3
59
+ }
60
+
45
61
e1: null & !=null
46
62
e2: !=null & null
47
63
e3: >1 & 1
@@ -126,6 +142,19 @@ e9: _|_ // conflicting values >"a" and <1 (mismatched types string and number)
126
142
s23d: (>0 & (int & <2))
127
143
s23e: (>0.0 & <2.0)
128
144
s30: (>0 & int)
145
+ floats: {
146
+ [string]: float
147
+ f1: (<10.0 & <=5.0)
148
+ f2: (<=10.0 & <5.0)
149
+ f3: (<1.1 & <=1.1)
150
+ f4: (<=1.1 & <=1.1)
151
+ f5: (>1.1 & >=1.1)
152
+ f6: (>=1.1 & >1.1)
153
+ f7: (>=1.1 & <=1.1)
154
+ issue1310: (>=2.1 & <=1.0)
155
+ fe2: (>2.1 & <=2.1)
156
+ fe3: ((float & >2) & <=3)
157
+ }
129
158
e1: (null & !=null)
130
159
e2: (!=null & null)
131
160
e3: (>1 & 1)
@@ -139,32 +168,38 @@ e9: _|_ // conflicting values >"a" and <1 (mismatched types string and number)
139
168
-- out/eval --
140
169
Errors:
141
170
e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
142
- ./in.cue:40 :5
143
- ./in.cue:40 :12
171
+ ./in.cue:56 :5
172
+ ./in.cue:56 :12
144
173
e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
145
- ./in.cue:41 :5
146
- ./in.cue:41 :14
174
+ ./in.cue:57 :5
175
+ ./in.cue:57 :14
147
176
e5: incompatible bounds >1 and <0:
148
- ./in.cue:44 :5
149
- ./in.cue:44 :10
177
+ ./in.cue:60 :5
178
+ ./in.cue:60 :10
150
179
e6: incompatible bounds >11 and <11:
151
- ./in.cue:45 :5
152
- ./in.cue:45 :11
180
+ ./in.cue:61 :5
181
+ ./in.cue:61 :11
153
182
e7: incompatible bounds >=11 and <11:
154
- ./in.cue:46 :5
155
- ./in.cue:46 :12
183
+ ./in.cue:62 :5
184
+ ./in.cue:62 :12
156
185
e8: incompatible bounds >11 and <=11:
157
- ./in.cue:47 :5
158
- ./in.cue:47 :11
186
+ ./in.cue:63 :5
187
+ ./in.cue:63 :11
159
188
e9: conflicting values >"a" and <1 (mismatched types string and number):
160
- ./in.cue:48:5
161
- ./in.cue:48:12
189
+ ./in.cue:64:5
190
+ ./in.cue:64:12
191
+ floats.fe2: incompatible bounds >2.1 and <=2.1:
192
+ ./in.cue:51:10
193
+ ./in.cue:51:17
194
+ floats.issue1310: incompatible bounds >=2.1 and <=1.0:
195
+ ./in.cue:50:16
196
+ ./in.cue:50:24
162
197
e3: invalid value 1 (out of bound >1):
163
- ./in.cue:42 :5
164
- ./in.cue:42 :10
198
+ ./in.cue:58 :5
199
+ ./in.cue:58 :10
165
200
e4: invalid value 0 (out of bound <0):
166
- ./in.cue:43 :5
167
- ./in.cue:43 :10
201
+ ./in.cue:59 :5
202
+ ./in.cue:59 :10
168
203
169
204
Result:
170
205
(_|_){
@@ -199,49 +234,70 @@ Result:
199
234
s23d: (int){ 1 }
200
235
s23e: (number){ &(>0.0, <2.0) }
201
236
s30: (int){ &(>0, int) }
237
+ floats: (_|_){
238
+ // [eval]
239
+ f1: (float){ &(<=5.0, float) }
240
+ f2: (float){ &(<5.0, float) }
241
+ f3: (float){ &(<1.1, float) }
242
+ f4: (float){ &(<=1.1, float) }
243
+ f5: (float){ &(>1.1, float) }
244
+ f6: (float){ &(>1.1, float) }
245
+ f7: (number){ 1.1 }
246
+ issue1310: (_|_){
247
+ // [eval] floats.issue1310: incompatible bounds >=2.1 and <=1.0:
248
+ // ./in.cue:50:16
249
+ // ./in.cue:50:24
250
+ }
251
+ fe2: (_|_){
252
+ // [eval] floats.fe2: incompatible bounds >2.1 and <=2.1:
253
+ // ./in.cue:51:10
254
+ // ./in.cue:51:17
255
+ }
256
+ fe3: (float){ &(>2, <=3, float) }
257
+ }
202
258
e1: (_|_){
203
259
// [eval] e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
204
- // ./in.cue:40 :5
205
- // ./in.cue:40 :12
260
+ // ./in.cue:56 :5
261
+ // ./in.cue:56 :12
206
262
}
207
263
e2: (_|_){
208
264
// [eval] e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
209
- // ./in.cue:41 :5
210
- // ./in.cue:41 :14
265
+ // ./in.cue:57 :5
266
+ // ./in.cue:57 :14
211
267
}
212
268
e3: (_|_){
213
269
// [eval] e3: invalid value 1 (out of bound >1):
214
- // ./in.cue:42 :5
215
- // ./in.cue:42 :10
270
+ // ./in.cue:58 :5
271
+ // ./in.cue:58 :10
216
272
}
217
273
e4: (_|_){
218
274
// [eval] e4: invalid value 0 (out of bound <0):
219
- // ./in.cue:43 :5
220
- // ./in.cue:43 :10
275
+ // ./in.cue:59 :5
276
+ // ./in.cue:59 :10
221
277
}
222
278
e5: (_|_){
223
279
// [eval] e5: incompatible bounds >1 and <0:
224
- // ./in.cue:44 :5
225
- // ./in.cue:44 :10
280
+ // ./in.cue:60 :5
281
+ // ./in.cue:60 :10
226
282
}
227
283
e6: (_|_){
228
284
// [eval] e6: incompatible bounds >11 and <11:
229
- // ./in.cue:45 :5
230
- // ./in.cue:45 :11
285
+ // ./in.cue:61 :5
286
+ // ./in.cue:61 :11
231
287
}
232
288
e7: (_|_){
233
289
// [eval] e7: incompatible bounds >=11 and <11:
234
- // ./in.cue:46 :5
235
- // ./in.cue:46 :12
290
+ // ./in.cue:62 :5
291
+ // ./in.cue:62 :12
236
292
}
237
293
e8: (_|_){
238
294
// [eval] e8: incompatible bounds >11 and <=11:
239
- // ./in.cue:47 :5
240
- // ./in.cue:47 :11
295
+ // ./in.cue:63 :5
296
+ // ./in.cue:63 :11
241
297
}
242
298
e9: (_|_){
243
299
// [eval] e9: conflicting values >"a" and <1 (mismatched types string and number):
244
- // ./in.cue:48 :5
245
- // ./in.cue:48 :12
300
+ // ./in.cue:64 :5
301
+ // ./in.cue:64 :12
246
302
}
247
303
}
0 commit comments