...
1# Some new cases specific to v0.7
2
3-- builtins.cue --
4import "strings"
5
6mutualBuiltin: t1: ok: {
7 // Results in incomplete error in v0.6
8 s3: strings.ContainsAny(s4)
9 s4: strings.ContainsAny(s3)
10 s4: "dd"
11}
12
13mutualBuiltin: t2: ok: {
14 s3: strings.ContainsAny(s5, "dd")
15 s5: s6
16 s6: "dd"
17}
18
19-- comprehensions.cue --
20comprehensions: t1: ok: {
21 src: ["foo"]
22 for v in src { "\(v)": v }
23}
24
25-- dynamic.cue --
26dynamic: t1: ok: {
27 [X=string]: {name: X}
28 (x.y): {}
29 x: y: "foo"
30}
31
32dynamic: t2: ok: {
33 foo: #X
34 #X: {
35 a: b: C: 1
36 for _ in a {
37 a: ("b"): D: 2
38 }
39 }
40}
41
42-- definition.cue --
43definition: t0: err: {
44 #D1: env: {}
45 d1: env: c: "C"
46 d1: #D1
47}
48
49definition: t1: err: {
50 a: #A
51 a: c: 1
52 // defining after first reference triggers notification mechanism to kick in.
53 #A: {}
54}
55
56definition: t2: ok: p1: {
57 #A: {
58 ...
59 {a: int}
60 }
61 x: #A & { c: int }
62}
63
64definition: t2: ok: p2: {
65 #A: {
66 {a: int}
67 ...
68 }
69 x: #A & { c: int }
70}
71
72definition: t2: ok: p3: {
73 x: #A & { c: int }
74 #A: {
75 ...
76 {a: int}
77 }
78}
79
80definition: t2: ok: p4: {
81 x: #A & { c: int }
82 #A: {
83 {a: int}
84 ...
85 }
86}
87
88-- expr.cue --
89expr: t1: ok: {
90 a: X
91 X: 5.0
92 X: Y / 2
93 Y: a * 2
94}
95
96expr: t2: ok: {
97 A: X + 2
98 X: 5
99 X: A - 2
100}
101
102expr: t3: ok: p1: {
103 a0: X
104 X: 5.0
105 X: a0 * 1
106}
107
108expr: t3: ok: p2: {
109 b: Y * 1
110 Y: b * 1
111 Y: 5.0
112}
113
114expr: t4: ok: {
115 // -> a0 -> X -> b1 -> b0 -> a1 -> a0
116 a0: X // Need all conjuncts known from X
117 b0: a1
118 a1: a0 + 2
119 b1: b0 - 2
120 a0: X
121 X: b1
122 X: 5.0
123}
124
125-- in.cue --
126mutual: t0: ok: {
127 c: e & {b: 2}
128 e: {a: 1}
129 e: c
130}
131
132mutual: t1: ok: {
133 a: {
134 b
135 b: {b: f: 1}
136 }
137 a: a.b
138 a: b: {b: f: 1}
139}
140
141mutual: t2: ok: {
142 x: a: a: f: 1
143 x: y.a
144 y: a: a: e: 1
145 y: x.a
146}
147
148mutual: t3: ok: {
149 d: e: f: 1
150 d
151 d: d: e: g: 1
152}
153
154// This test fails for some permutations in v0.6.
155mutual: t4: ok: {
156 p0: {
157 z: x.b
158 x: b: y.c
159 x: b: {d: b: 2}
160 y: c: z.d
161 z: d: {a: 1}
162 }
163
164 p1: {
165 x: b: y.c
166 z: x.b
167 x: b: {d: b: 2}
168 y: c: z.d
169 z: d: {a: 1}
170 }
171
172 p2: {
173 x: b: y.c
174 x: b: {d: b: 2}
175 y: c: z.d
176 z: x.b
177 z: d: {a: 1}
178 }
179
180 p3: {
181 x: b: {d: b: 2}
182 y: c: z.d
183 z: x.b
184 x: b: y.c
185 z: d: {a: 1}
186 }
187
188 p4: {
189 z: x.b
190 x: b: {d: b: 2}
191 y: c: z.d
192 x: b: y.c
193 z: d: {a: 1}
194 }
195
196 p5: {
197 x: b: {d: b: 2}
198 y: c: z.d
199 x: b: y.c
200 z: x.b
201 z: d: {a: 1}
202 }
203
204 check: p1 & p2 & p3 & p4 & p5
205}
206
207-- out/eval/stats --
208Leaks: 0
209Freed: 261
210Reused: 249
211Allocs: 12
212Retain: 166
213
214Unifications: 261
215Conjuncts: 1578
216Disjuncts: 408
217-- out/eval --
218Errors:
219definition.t0.err.d1.env.c: field not allowed:
220 ./definition.cue:2:12
221 ./definition.cue:3:11
222 ./definition.cue:4:6
223definition.t1.err.a.c: field not allowed:
224 ./definition.cue:8:5
225 ./definition.cue:9:5
226 ./definition.cue:11:6
227mutual.t4.ok.p0.z: cannot add to field b
228mutual.t4.ok.p0.z: cannot add to field c
229mutual.t4.ok.p4.z: cannot add to field b
230mutual.t4.ok.p4.z: cannot add to field c
231
232Result:
233(_|_){
234 // [eval]
235 mutualBuiltin: (struct){
236 t1: (struct){
237 ok: (struct){
238 s3: (string){ strings.ContainsAny("dd") }
239 s4: (_|_){
240 // [incomplete] mutualBuiltin.t1.ok.s4: invalid value "dd" (does not satisfy strings.ContainsAny(strings.ContainsAny("dd"))): error in call to strings.ContainsAny: non-concrete value string:
241 // ./builtins.cue:6:6
242 // ./builtins.cue:5:6
243 // ./builtins.cue:7:6
244 }
245 }
246 }
247 t2: (struct){
248 ok: (struct){
249 s3: (bool){ true }
250 s5: (string){ "dd" }
251 s6: (string){ "dd" }
252 }
253 }
254 }
255 comprehensions: (struct){
256 t1: (struct){
257 ok: (struct){
258 src: (#list){
259 0: (string){ "foo" }
260 }
261 foo: (string){ "foo" }
262 }
263 }
264 }
265 definition: (_|_){
266 // [eval]
267 t0: (_|_){
268 // [eval]
269 err: (_|_){
270 // [eval]
271 #D1: (#struct){
272 env: (#struct){
273 }
274 }
275 d1: (_|_){
276 // [eval]
277 env: (_|_){
278 // [eval]
279 c: (_|_){
280 // [eval] definition.t0.err.d1.env.c: field not allowed:
281 // ./definition.cue:2:12
282 // ./definition.cue:3:11
283 // ./definition.cue:4:6
284 }
285 }
286 }
287 }
288 }
289 t1: (_|_){
290 // [eval]
291 err: (_|_){
292 // [eval]
293 a: (_|_){
294 // [eval]
295 c: (_|_){
296 // [eval] definition.t1.err.a.c: field not allowed:
297 // ./definition.cue:8:5
298 // ./definition.cue:9:5
299 // ./definition.cue:11:6
300 }
301 }
302 #A: (#struct){
303 }
304 }
305 }
306 t2: (struct){
307 ok: (struct){
308 p1: (struct){
309 #A: (#struct){
310 a: (int){ int }
311 }
312 x: (#struct){
313 a: (int){ int }
314 c: (int){ int }
315 }
316 }
317 p2: (struct){
318 #A: (#struct){
319 a: (int){ int }
320 }
321 x: (#struct){
322 a: (int){ int }
323 c: (int){ int }
324 }
325 }
326 p3: (struct){
327 x: (#struct){
328 a: (int){ int }
329 c: (int){ int }
330 }
331 #A: (#struct){
332 a: (int){ int }
333 }
334 }
335 p4: (struct){
336 x: (#struct){
337 a: (int){ int }
338 c: (int){ int }
339 }
340 #A: (#struct){
341 a: (int){ int }
342 }
343 }
344 }
345 }
346 }
347 dynamic: (struct){
348 t1: (struct){
349 ok: (struct){
350 x: (struct){
351 y: (string){ "foo" }
352 name: (string){ "x" }
353 }
354 foo: (struct){
355 name: (string){ "foo" }
356 }
357 }
358 }
359 t2: (struct){
360 ok: (struct){
361 foo: (#struct){
362 a: (#struct){
363 b: (#struct){
364 C: (int){ 1 }
365 D: (int){ 2 }
366 }
367 }
368 }
369 #X: (#struct){
370 a: (#struct){
371 b: (#struct){
372 C: (int){ 1 }
373 D: (int){ 2 }
374 }
375 }
376 }
377 }
378 }
379 }
380 expr: (struct){
381 t1: (struct){
382 ok: (struct){
383 a: (float){ 5.0 }
384 X: (float){ 5.0 }
385 Y: (float){ 10.0 }
386 }
387 }
388 t2: (struct){
389 ok: (struct){
390 A: (int){ 7 }
391 X: (int){ 5 }
392 }
393 }
394 t3: (struct){
395 ok: (struct){
396 p1: (struct){
397 a0: (float){ 5.0 }
398 X: (float){ 5.0 }
399 }
400 p2: (struct){
401 b: (float){ 5.0 }
402 Y: (float){ 5.0 }
403 }
404 }
405 }
406 t4: (struct){
407 ok: (struct){
408 a0: (float){ 5.0 }
409 b0: (float){ 7.0 }
410 a1: (float){ 7.0 }
411 b1: (float){ 5.0 }
412 X: (float){ 5.0 }
413 }
414 }
415 }
416 mutual: (_|_){
417 // [eval]
418 t0: (struct){
419 ok: (struct){
420 c: (struct){
421 b: (int){ 2 }
422 a: (int){ 1 }
423 }
424 e: (struct){
425 a: (int){ 1 }
426 b: (int){ 2 }
427 }
428 }
429 }
430 t1: (struct){
431 ok: (struct){
432 a: (struct){
433 b: (struct){
434 b: (struct){
435 f: (int){ 1 }
436 }
437 f: (int){ 1 }
438 }
439 f: (int){ 1 }
440 }
441 }
442 }
443 t2: (struct){
444 ok: (struct){
445 x: (struct){
446 a: (struct){
447 a: (struct){
448 f: (int){ 1 }
449 }
450 e: (int){ 1 }
451 }
452 f: (int){ 1 }
453 }
454 y: (struct){
455 a: (struct){
456 a: (struct){
457 e: (int){ 1 }
458 }
459 f: (int){ 1 }
460 }
461 e: (int){ 1 }
462 }
463 }
464 }
465 t3: (struct){
466 ok: (struct){
467 d: (struct){
468 e: (struct){
469 f: (int){ 1 }
470 g: (int){ 1 }
471 }
472 d: (struct){
473 e: (struct){
474 g: (int){ 1 }
475 }
476 }
477 }
478 e: (struct){
479 f: (int){ 1 }
480 g: (int){ 1 }
481 }
482 }
483 }
484 t4: (_|_){
485 // [eval]
486 ok: (_|_){
487 // [eval]
488 p0: (_|_){
489 // [eval]
490 z: (_|_){
491 // [eval] mutual.t4.ok.p0.z: cannot add to field b
492 // mutual.t4.ok.p0.z: cannot add to field c
493 d: (struct){
494 a: (int){ 1 }
495 b: (int){ 2 }
496 }
497 a: (int){ 1 }
498 b: (int){ 2 }
499 }
500 x: (struct){
501 b: (struct){
502 a: (int){ 1 }
503 d: (struct){
504 b: (int){ 2 }
505 }
506 }
507 }
508 y: (struct){
509 c: (struct){
510 a: (int){ 1 }
511 }
512 }
513 }
514 p1: (struct){
515 x: (struct){
516 b: (struct){
517 d: (struct){
518 b: (int){ 2 }
519 }
520 a: (int){ 1 }
521 b: (int){ 2 }
522 }
523 }
524 z: (struct){
525 d: (struct){
526 a: (int){ 1 }
527 b: (int){ 2 }
528 }
529 a: (int){ 1 }
530 b: (int){ 2 }
531 }
532 y: (struct){
533 c: (struct){
534 a: (int){ 1 }
535 b: (int){ 2 }
536 }
537 }
538 }
539 p2: (struct){
540 x: (struct){
541 b: (struct){
542 d: (struct){
543 b: (int){ 2 }
544 }
545 a: (int){ 1 }
546 b: (int){ 2 }
547 }
548 }
549 y: (struct){
550 c: (struct){
551 a: (int){ 1 }
552 b: (int){ 2 }
553 }
554 }
555 z: (struct){
556 d: (struct){
557 a: (int){ 1 }
558 b: (int){ 2 }
559 }
560 a: (int){ 1 }
561 b: (int){ 2 }
562 }
563 }
564 p3: (struct){
565 x: (struct){
566 b: (struct){
567 d: (struct){
568 b: (int){ 2 }
569 }
570 b: (int){ 2 }
571 a: (int){ 1 }
572 }
573 }
574 y: (struct){
575 c: (struct){
576 b: (int){ 2 }
577 a: (int){ 1 }
578 }
579 }
580 z: (struct){
581 d: (struct){
582 b: (int){ 2 }
583 a: (int){ 1 }
584 }
585 b: (int){ 2 }
586 a: (int){ 1 }
587 }
588 }
589 p4: (_|_){
590 // [eval]
591 z: (_|_){
592 // [eval] mutual.t4.ok.p4.z: cannot add to field b
593 // mutual.t4.ok.p4.z: cannot add to field c
594 d: (struct){
595 a: (int){ 1 }
596 b: (int){ 2 }
597 }
598 a: (int){ 1 }
599 b: (int){ 2 }
600 }
601 x: (struct){
602 b: (struct){
603 d: (struct){
604 b: (int){ 2 }
605 }
606 a: (int){ 1 }
607 }
608 }
609 y: (struct){
610 c: (struct){
611 a: (int){ 1 }
612 }
613 }
614 }
615 p5: (struct){
616 x: (struct){
617 b: (struct){
618 d: (struct){
619 b: (int){ 2 }
620 }
621 b: (int){ 2 }
622 a: (int){ 1 }
623 }
624 }
625 y: (struct){
626 c: (struct){
627 b: (int){ 2 }
628 a: (int){ 1 }
629 }
630 }
631 z: (struct){
632 d: (struct){
633 b: (int){ 2 }
634 a: (int){ 1 }
635 }
636 b: (int){ 2 }
637 a: (int){ 1 }
638 }
639 }
640 check: (struct){
641 x: (struct){
642 b: (struct){
643 d: (struct){
644 b: (int){ 2 }
645 }
646 a: (int){ 1 }
647 b: (int){ 2 }
648 }
649 }
650 z: (struct){
651 d: (struct){
652 a: (int){ 1 }
653 b: (int){ 2 }
654 }
655 a: (int){ 1 }
656 b: (int){ 2 }
657 }
658 y: (struct){
659 c: (struct){
660 a: (int){ 1 }
661 b: (int){ 2 }
662 }
663 }
664 }
665 }
666 }
667 }
668}
669-- out/evalalpha --
670Errors:
671definition.t0.err.d1.env.c: field not allowed:
672 ./definition.cue:3:11
673definition.t1.err.a.c: field not allowed:
674 ./definition.cue:8:5
675 ./definition.cue:9:5
676
677Result:
678(_|_){
679 // [eval]
680 mutualBuiltin: (struct){
681 t1: (struct){
682 ok: (struct){
683 s3: (string){ strings.ContainsAny("dd") }
684 s4: (string){ "dd" }
685 }
686 }
687 t2: (struct){
688 ok: (struct){
689 s3: (bool){ true }
690 s5: (string){ "dd" }
691 s6: (string){ "dd" }
692 }
693 }
694 }
695 comprehensions: (struct){
696 t1: (struct){
697 ok: (struct){
698 src: (#list){
699 0: (string){ "foo" }
700 }
701 foo: (string){ "foo" }
702 }
703 }
704 }
705 definition: (_|_){
706 // [eval]
707 t0: (_|_){
708 // [eval]
709 err: (_|_){
710 // [eval]
711 #D1: (#struct){
712 env: (#struct){
713 }
714 }
715 d1: (_|_){
716 // [eval]
717 env: (_|_){
718 // [eval]
719 c: (_|_){
720 // [eval] definition.t0.err.d1.env.c: field not allowed:
721 // ./definition.cue:3:11
722 }
723 }
724 }
725 }
726 }
727 t1: (_|_){
728 // [eval]
729 err: (_|_){
730 // [eval]
731 a: (_|_){
732 // [eval]
733 c: (_|_){
734 // [eval] definition.t1.err.a.c: field not allowed:
735 // ./definition.cue:8:5
736 // ./definition.cue:9:5
737 }
738 }
739 #A: (#struct){
740 }
741 }
742 }
743 t2: (struct){
744 ok: (struct){
745 p1: (struct){
746 #A: (#struct){
747 a: (int){ int }
748 }
749 x: (#struct){
750 c: (int){ int }
751 a: (int){ int }
752 }
753 }
754 p2: (struct){
755 #A: (#struct){
756 a: (int){ int }
757 }
758 x: (#struct){
759 c: (int){ int }
760 a: (int){ int }
761 }
762 }
763 p3: (struct){
764 x: (#struct){
765 c: (int){ int }
766 a: (int){ int }
767 }
768 #A: (#struct){
769 a: (int){ int }
770 }
771 }
772 p4: (struct){
773 x: (#struct){
774 c: (int){ int }
775 a: (int){ int }
776 }
777 #A: (#struct){
778 a: (int){ int }
779 }
780 }
781 }
782 }
783 }
784 dynamic: (struct){
785 t1: (struct){
786 ok: (struct){
787 x: (struct){
788 y: (string){ "foo" }
789 name: (string){ "x" }
790 }
791 foo: (struct){
792 name: (string){ "foo" }
793 }
794 }
795 }
796 t2: (struct){
797 ok: (struct){
798 foo: (#struct){
799 a: (#struct){
800 b: (#struct){
801 C: (int){ 1 }
802 D: (int){ 2 }
803 }
804 }
805 }
806 #X: (#struct){
807 a: (#struct){
808 b: (#struct){
809 C: (int){ 1 }
810 D: (int){ 2 }
811 }
812 }
813 }
814 }
815 }
816 }
817 expr: (struct){
818 t1: (struct){
819 ok: (struct){
820 a: (float){ 5.0 }
821 X: (float){ 5.0 }
822 Y: (float){ 10.0 }
823 }
824 }
825 t2: (struct){
826 ok: (struct){
827 A: (int){ 7 }
828 X: (int){ 5 }
829 }
830 }
831 t3: (struct){
832 ok: (struct){
833 p1: (struct){
834 a0: (float){ 5.0 }
835 X: (float){ 5.0 }
836 }
837 p2: (struct){
838 b: (float){ 5.0 }
839 Y: (float){ 5.0 }
840 }
841 }
842 }
843 t4: (struct){
844 ok: (struct){
845 a0: (float){ 5.0 }
846 b0: (float){ 7.0 }
847 a1: (float){ 7.0 }
848 b1: (float){ 5.0 }
849 X: (float){ 5.0 }
850 }
851 }
852 }
853 mutual: (struct){
854 t0: (struct){
855 ok: (struct){
856 c: (struct){
857 b: (int){ 2 }
858 a: (int){ 1 }
859 }
860 e: (struct){
861 a: (int){ 1 }
862 b: (int){ 2 }
863 }
864 }
865 }
866 t1: (struct){
867 ok: (struct){
868 a: (struct){
869 b: (struct){
870 b: (struct){
871 f: (int){ 1 }
872 }
873 f: (int){ 1 }
874 }
875 f: (int){ 1 }
876 }
877 }
878 }
879 t2: (struct){
880 ok: (struct){
881 x: (struct){
882 a: (struct){
883 a: (struct){
884 f: (int){ 1 }
885 }
886 e: (int){ 1 }
887 }
888 f: (int){ 1 }
889 }
890 y: (struct){
891 a: (struct){
892 a: (struct){
893 e: (int){ 1 }
894 }
895 f: (int){ 1 }
896 }
897 e: (int){ 1 }
898 }
899 }
900 }
901 t3: (struct){
902 ok: (struct){
903 d: (struct){
904 e: (struct){
905 f: (int){ 1 }
906 g: (int){ 1 }
907 }
908 d: (struct){
909 e: (struct){
910 g: (int){ 1 }
911 }
912 }
913 }
914 e: (struct){
915 f: (int){ 1 }
916 g: (int){ 1 }
917 }
918 }
919 }
920 t4: (struct){
921 ok: (struct){
922 p0: (struct){
923 z: (struct){
924 d: (struct){
925 a: (int){ 1 }
926 b: (int){ 2 }
927 }
928 b: (int){ 2 }
929 a: (int){ 1 }
930 }
931 x: (struct){
932 b: (struct){
933 d: (struct){
934 b: (int){ 2 }
935 }
936 a: (int){ 1 }
937 b: (int){ 2 }
938 }
939 }
940 y: (struct){
941 c: (struct){
942 a: (int){ 1 }
943 b: (int){ 2 }
944 }
945 }
946 }
947 p1: (struct){
948 x: (struct){
949 b: (struct){
950 d: (struct){
951 b: (int){ 2 }
952 }
953 a: (int){ 1 }
954 b: (int){ 2 }
955 }
956 }
957 z: (struct){
958 d: (struct){
959 a: (int){ 1 }
960 b: (int){ 2 }
961 }
962 a: (int){ 1 }
963 b: (int){ 2 }
964 }
965 y: (struct){
966 c: (struct){
967 a: (int){ 1 }
968 b: (int){ 2 }
969 }
970 }
971 }
972 p2: (struct){
973 x: (struct){
974 b: (struct){
975 d: (struct){
976 b: (int){ 2 }
977 }
978 a: (int){ 1 }
979 b: (int){ 2 }
980 }
981 }
982 y: (struct){
983 c: (struct){
984 a: (int){ 1 }
985 b: (int){ 2 }
986 }
987 }
988 z: (struct){
989 d: (struct){
990 a: (int){ 1 }
991 b: (int){ 2 }
992 }
993 a: (int){ 1 }
994 b: (int){ 2 }
995 }
996 }
997 p3: (struct){
998 x: (struct){
999 b: (struct){
1000 d: (struct){
1001 b: (int){ 2 }
1002 }
1003 a: (int){ 1 }
1004 b: (int){ 2 }
1005 }
1006 }
1007 y: (struct){
1008 c: (struct){
1009 a: (int){ 1 }
1010 b: (int){ 2 }
1011 }
1012 }
1013 z: (struct){
1014 d: (struct){
1015 a: (int){ 1 }
1016 b: (int){ 2 }
1017 }
1018 a: (int){ 1 }
1019 b: (int){ 2 }
1020 }
1021 }
1022 p4: (struct){
1023 z: (struct){
1024 d: (struct){
1025 a: (int){ 1 }
1026 b: (int){ 2 }
1027 }
1028 b: (int){ 2 }
1029 a: (int){ 1 }
1030 }
1031 x: (struct){
1032 b: (struct){
1033 d: (struct){
1034 b: (int){ 2 }
1035 }
1036 a: (int){ 1 }
1037 b: (int){ 2 }
1038 }
1039 }
1040 y: (struct){
1041 c: (struct){
1042 a: (int){ 1 }
1043 b: (int){ 2 }
1044 }
1045 }
1046 }
1047 p5: (struct){
1048 x: (struct){
1049 b: (struct){
1050 d: (struct){
1051 b: (int){ 2 }
1052 }
1053 a: (int){ 1 }
1054 b: (int){ 2 }
1055 }
1056 }
1057 y: (struct){
1058 c: (struct){
1059 a: (int){ 1 }
1060 b: (int){ 2 }
1061 }
1062 }
1063 z: (struct){
1064 d: (struct){
1065 a: (int){ 1 }
1066 b: (int){ 2 }
1067 }
1068 a: (int){ 1 }
1069 b: (int){ 2 }
1070 }
1071 }
1072 check: (struct){
1073 x: (struct){
1074 b: (struct){
1075 d: (struct){
1076 b: (int){ 2 }
1077 }
1078 a: (int){ 1 }
1079 b: (int){ 2 }
1080 }
1081 }
1082 z: (struct){
1083 d: (struct){
1084 a: (int){ 1 }
1085 b: (int){ 2 }
1086 }
1087 a: (int){ 1 }
1088 b: (int){ 2 }
1089 }
1090 y: (struct){
1091 c: (struct){
1092 a: (int){ 1 }
1093 b: (int){ 2 }
1094 }
1095 }
1096 }
1097 }
1098 }
1099 }
1100}
1101-- diff/-out/evalalpha<==>+out/eval --
1102diff old new
1103--- old
1104+++ new
1105@@ -1,16 +1,9 @@
1106 Errors:
1107 definition.t0.err.d1.env.c: field not allowed:
1108- ./definition.cue:2:12
1109 ./definition.cue:3:11
1110- ./definition.cue:4:6
1111 definition.t1.err.a.c: field not allowed:
1112 ./definition.cue:8:5
1113 ./definition.cue:9:5
1114- ./definition.cue:11:6
1115-mutual.t4.ok.p0.z: cannot add to field b
1116-mutual.t4.ok.p0.z: cannot add to field c
1117-mutual.t4.ok.p4.z: cannot add to field b
1118-mutual.t4.ok.p4.z: cannot add to field c
1119
1120 Result:
1121 (_|_){
1122@@ -19,12 +12,7 @@
1123 t1: (struct){
1124 ok: (struct){
1125 s3: (string){ strings.ContainsAny("dd") }
1126- s4: (_|_){
1127- // [incomplete] mutualBuiltin.t1.ok.s4: invalid value "dd" (does not satisfy strings.ContainsAny(strings.ContainsAny("dd"))): error in call to strings.ContainsAny: non-concrete value string:
1128- // ./builtins.cue:6:6
1129- // ./builtins.cue:5:6
1130- // ./builtins.cue:7:6
1131- }
1132+ s4: (string){ "dd" }
1133 }
1134 }
1135 t2: (struct){
1136@@ -61,9 +49,7 @@
1137 // [eval]
1138 c: (_|_){
1139 // [eval] definition.t0.err.d1.env.c: field not allowed:
1140- // ./definition.cue:2:12
1141 // ./definition.cue:3:11
1142- // ./definition.cue:4:6
1143 }
1144 }
1145 }
1146@@ -79,7 +65,6 @@
1147 // [eval] definition.t1.err.a.c: field not allowed:
1148 // ./definition.cue:8:5
1149 // ./definition.cue:9:5
1150- // ./definition.cue:11:6
1151 }
1152 }
1153 #A: (#struct){
1154@@ -93,32 +78,32 @@
1155 a: (int){ int }
1156 }
1157 x: (#struct){
1158- a: (int){ int }
1159- c: (int){ int }
1160- }
1161- }
1162- p2: (struct){
1163- #A: (#struct){
1164- a: (int){ int }
1165- }
1166- x: (#struct){
1167- a: (int){ int }
1168- c: (int){ int }
1169- }
1170- }
1171- p3: (struct){
1172- x: (#struct){
1173- a: (int){ int }
1174- c: (int){ int }
1175- }
1176- #A: (#struct){
1177- a: (int){ int }
1178- }
1179- }
1180- p4: (struct){
1181- x: (#struct){
1182- a: (int){ int }
1183- c: (int){ int }
1184+ c: (int){ int }
1185+ a: (int){ int }
1186+ }
1187+ }
1188+ p2: (struct){
1189+ #A: (#struct){
1190+ a: (int){ int }
1191+ }
1192+ x: (#struct){
1193+ c: (int){ int }
1194+ a: (int){ int }
1195+ }
1196+ }
1197+ p3: (struct){
1198+ x: (#struct){
1199+ c: (int){ int }
1200+ a: (int){ int }
1201+ }
1202+ #A: (#struct){
1203+ a: (int){ int }
1204+ }
1205+ }
1206+ p4: (struct){
1207+ x: (#struct){
1208+ c: (int){ int }
1209+ a: (int){ int }
1210 }
1211 #A: (#struct){
1212 a: (int){ int }
1213@@ -196,8 +181,7 @@
1214 }
1215 }
1216 }
1217- mutual: (_|_){
1218- // [eval]
1219+ mutual: (struct){
1220 t0: (struct){
1221 ok: (struct){
1222 c: (struct){
1223@@ -264,134 +248,130 @@
1224 }
1225 }
1226 }
1227- t4: (_|_){
1228- // [eval]
1229- ok: (_|_){
1230- // [eval]
1231- p0: (_|_){
1232- // [eval]
1233- z: (_|_){
1234- // [eval] mutual.t4.ok.p0.z: cannot add to field b
1235- // mutual.t4.ok.p0.z: cannot add to field c
1236- d: (struct){
1237- a: (int){ 1 }
1238- b: (int){ 2 }
1239- }
1240- a: (int){ 1 }
1241- b: (int){ 2 }
1242- }
1243- x: (struct){
1244- b: (struct){
1245- a: (int){ 1 }
1246- d: (struct){
1247- b: (int){ 2 }
1248- }
1249- }
1250- }
1251- y: (struct){
1252- c: (struct){
1253- a: (int){ 1 }
1254- }
1255- }
1256- }
1257- p1: (struct){
1258- x: (struct){
1259- b: (struct){
1260- d: (struct){
1261- b: (int){ 2 }
1262- }
1263- a: (int){ 1 }
1264- b: (int){ 2 }
1265- }
1266- }
1267- z: (struct){
1268- d: (struct){
1269- a: (int){ 1 }
1270- b: (int){ 2 }
1271- }
1272- a: (int){ 1 }
1273- b: (int){ 2 }
1274- }
1275- y: (struct){
1276- c: (struct){
1277- a: (int){ 1 }
1278- b: (int){ 2 }
1279- }
1280- }
1281- }
1282- p2: (struct){
1283- x: (struct){
1284- b: (struct){
1285- d: (struct){
1286- b: (int){ 2 }
1287- }
1288- a: (int){ 1 }
1289- b: (int){ 2 }
1290- }
1291- }
1292- y: (struct){
1293- c: (struct){
1294- a: (int){ 1 }
1295- b: (int){ 2 }
1296- }
1297- }
1298- z: (struct){
1299- d: (struct){
1300- a: (int){ 1 }
1301- b: (int){ 2 }
1302- }
1303- a: (int){ 1 }
1304- b: (int){ 2 }
1305- }
1306- }
1307- p3: (struct){
1308- x: (struct){
1309- b: (struct){
1310- d: (struct){
1311- b: (int){ 2 }
1312- }
1313- b: (int){ 2 }
1314- a: (int){ 1 }
1315- }
1316- }
1317- y: (struct){
1318- c: (struct){
1319- b: (int){ 2 }
1320- a: (int){ 1 }
1321- }
1322- }
1323- z: (struct){
1324- d: (struct){
1325- b: (int){ 2 }
1326- a: (int){ 1 }
1327- }
1328- b: (int){ 2 }
1329- a: (int){ 1 }
1330- }
1331- }
1332- p4: (_|_){
1333- // [eval]
1334- z: (_|_){
1335- // [eval] mutual.t4.ok.p4.z: cannot add to field b
1336- // mutual.t4.ok.p4.z: cannot add to field c
1337- d: (struct){
1338- a: (int){ 1 }
1339- b: (int){ 2 }
1340- }
1341- a: (int){ 1 }
1342- b: (int){ 2 }
1343- }
1344- x: (struct){
1345- b: (struct){
1346- d: (struct){
1347- b: (int){ 2 }
1348- }
1349- a: (int){ 1 }
1350- }
1351- }
1352- y: (struct){
1353- c: (struct){
1354- a: (int){ 1 }
1355+ t4: (struct){
1356+ ok: (struct){
1357+ p0: (struct){
1358+ z: (struct){
1359+ d: (struct){
1360+ a: (int){ 1 }
1361+ b: (int){ 2 }
1362+ }
1363+ b: (int){ 2 }
1364+ a: (int){ 1 }
1365+ }
1366+ x: (struct){
1367+ b: (struct){
1368+ d: (struct){
1369+ b: (int){ 2 }
1370+ }
1371+ a: (int){ 1 }
1372+ b: (int){ 2 }
1373+ }
1374+ }
1375+ y: (struct){
1376+ c: (struct){
1377+ a: (int){ 1 }
1378+ b: (int){ 2 }
1379+ }
1380+ }
1381+ }
1382+ p1: (struct){
1383+ x: (struct){
1384+ b: (struct){
1385+ d: (struct){
1386+ b: (int){ 2 }
1387+ }
1388+ a: (int){ 1 }
1389+ b: (int){ 2 }
1390+ }
1391+ }
1392+ z: (struct){
1393+ d: (struct){
1394+ a: (int){ 1 }
1395+ b: (int){ 2 }
1396+ }
1397+ a: (int){ 1 }
1398+ b: (int){ 2 }
1399+ }
1400+ y: (struct){
1401+ c: (struct){
1402+ a: (int){ 1 }
1403+ b: (int){ 2 }
1404+ }
1405+ }
1406+ }
1407+ p2: (struct){
1408+ x: (struct){
1409+ b: (struct){
1410+ d: (struct){
1411+ b: (int){ 2 }
1412+ }
1413+ a: (int){ 1 }
1414+ b: (int){ 2 }
1415+ }
1416+ }
1417+ y: (struct){
1418+ c: (struct){
1419+ a: (int){ 1 }
1420+ b: (int){ 2 }
1421+ }
1422+ }
1423+ z: (struct){
1424+ d: (struct){
1425+ a: (int){ 1 }
1426+ b: (int){ 2 }
1427+ }
1428+ a: (int){ 1 }
1429+ b: (int){ 2 }
1430+ }
1431+ }
1432+ p3: (struct){
1433+ x: (struct){
1434+ b: (struct){
1435+ d: (struct){
1436+ b: (int){ 2 }
1437+ }
1438+ a: (int){ 1 }
1439+ b: (int){ 2 }
1440+ }
1441+ }
1442+ y: (struct){
1443+ c: (struct){
1444+ a: (int){ 1 }
1445+ b: (int){ 2 }
1446+ }
1447+ }
1448+ z: (struct){
1449+ d: (struct){
1450+ a: (int){ 1 }
1451+ b: (int){ 2 }
1452+ }
1453+ a: (int){ 1 }
1454+ b: (int){ 2 }
1455+ }
1456+ }
1457+ p4: (struct){
1458+ z: (struct){
1459+ d: (struct){
1460+ a: (int){ 1 }
1461+ b: (int){ 2 }
1462+ }
1463+ b: (int){ 2 }
1464+ a: (int){ 1 }
1465+ }
1466+ x: (struct){
1467+ b: (struct){
1468+ d: (struct){
1469+ b: (int){ 2 }
1470+ }
1471+ a: (int){ 1 }
1472+ b: (int){ 2 }
1473+ }
1474+ }
1475+ y: (struct){
1476+ c: (struct){
1477+ a: (int){ 1 }
1478+ b: (int){ 2 }
1479 }
1480 }
1481 }
1482@@ -401,23 +381,23 @@
1483 d: (struct){
1484 b: (int){ 2 }
1485 }
1486- b: (int){ 2 }
1487- a: (int){ 1 }
1488- }
1489- }
1490- y: (struct){
1491- c: (struct){
1492- b: (int){ 2 }
1493- a: (int){ 1 }
1494- }
1495- }
1496- z: (struct){
1497- d: (struct){
1498- b: (int){ 2 }
1499- a: (int){ 1 }
1500- }
1501- b: (int){ 2 }
1502- a: (int){ 1 }
1503+ a: (int){ 1 }
1504+ b: (int){ 2 }
1505+ }
1506+ }
1507+ y: (struct){
1508+ c: (struct){
1509+ a: (int){ 1 }
1510+ b: (int){ 2 }
1511+ }
1512+ }
1513+ z: (struct){
1514+ d: (struct){
1515+ a: (int){ 1 }
1516+ b: (int){ 2 }
1517+ }
1518+ a: (int){ 1 }
1519+ b: (int){ 2 }
1520 }
1521 }
1522 check: (struct){
1523-- diff/explanation --
1524Bug fixes
1525-- diff/todo/p2 --
1526Reordering / positions.
1527-- out/compile --
1528--- builtins.cue
1529{
1530 mutualBuiltin: {
1531 t1: {
1532 ok: {
1533 s3: 〈import;strings〉.ContainsAny(〈0;s4〉)
1534 s4: 〈import;strings〉.ContainsAny(〈0;s3〉)
1535 s4: "dd"
1536 }
1537 }
1538 }
1539 mutualBuiltin: {
1540 t2: {
1541 ok: {
1542 s3: 〈import;strings〉.ContainsAny(〈0;s5〉, "dd")
1543 s5: 〈0;s6〉
1544 s6: "dd"
1545 }
1546 }
1547 }
1548}
1549--- comprehensions.cue
1550{
1551 comprehensions: {
1552 t1: {
1553 ok: {
1554 src: [
1555 "foo",
1556 ]
1557 for _, v in 〈0;src〉 {
1558 "\(〈1;v〉)": 〈1;v〉
1559 }
1560 }
1561 }
1562 }
1563}
1564--- definition.cue
1565{
1566 definition: {
1567 t0: {
1568 err: {
1569 #D1: {
1570 env: {}
1571 }
1572 d1: {
1573 env: {
1574 c: "C"
1575 }
1576 }
1577 d1: 〈0;#D1〉
1578 }
1579 }
1580 }
1581 definition: {
1582 t1: {
1583 err: {
1584 a: 〈0;#A〉
1585 a: {
1586 c: 1
1587 }
1588 #A: {}
1589 }
1590 }
1591 }
1592 definition: {
1593 t2: {
1594 ok: {
1595 p1: {
1596 #A: {
1597 ...
1598 {
1599 a: int
1600 }
1601 }
1602 x: (〈0;#A〉 & {
1603 c: int
1604 })
1605 }
1606 }
1607 }
1608 }
1609 definition: {
1610 t2: {
1611 ok: {
1612 p2: {
1613 #A: {
1614 {
1615 a: int
1616 }
1617 ...
1618 }
1619 x: (〈0;#A〉 & {
1620 c: int
1621 })
1622 }
1623 }
1624 }
1625 }
1626 definition: {
1627 t2: {
1628 ok: {
1629 p3: {
1630 x: (〈0;#A〉 & {
1631 c: int
1632 })
1633 #A: {
1634 ...
1635 {
1636 a: int
1637 }
1638 }
1639 }
1640 }
1641 }
1642 }
1643 definition: {
1644 t2: {
1645 ok: {
1646 p4: {
1647 x: (〈0;#A〉 & {
1648 c: int
1649 })
1650 #A: {
1651 {
1652 a: int
1653 }
1654 ...
1655 }
1656 }
1657 }
1658 }
1659 }
1660}
1661--- dynamic.cue
1662{
1663 dynamic: {
1664 t1: {
1665 ok: {
1666 [string]: {
1667 name: 〈1;-〉
1668 }
1669 〈0;x〉.y: {}
1670 x: {
1671 y: "foo"
1672 }
1673 }
1674 }
1675 }
1676 dynamic: {
1677 t2: {
1678 ok: {
1679 foo: 〈0;#X〉
1680 #X: {
1681 a: {
1682 b: {
1683 C: 1
1684 }
1685 }
1686 for _, _ in 〈0;a〉 {
1687 a: {
1688 "b": {
1689 D: 2
1690 }
1691 }
1692 }
1693 }
1694 }
1695 }
1696 }
1697}
1698--- expr.cue
1699{
1700 expr: {
1701 t1: {
1702 ok: {
1703 a: 〈0;X〉
1704 X: 5.0
1705 X: (〈0;Y〉 / 2)
1706 Y: (〈0;a〉 * 2)
1707 }
1708 }
1709 }
1710 expr: {
1711 t2: {
1712 ok: {
1713 A: (〈0;X〉 + 2)
1714 X: 5
1715 X: (〈0;A〉 - 2)
1716 }
1717 }
1718 }
1719 expr: {
1720 t3: {
1721 ok: {
1722 p1: {
1723 a0: 〈0;X〉
1724 X: 5.0
1725 X: (〈0;a0〉 * 1)
1726 }
1727 }
1728 }
1729 }
1730 expr: {
1731 t3: {
1732 ok: {
1733 p2: {
1734 b: (〈0;Y〉 * 1)
1735 Y: (〈0;b〉 * 1)
1736 Y: 5.0
1737 }
1738 }
1739 }
1740 }
1741 expr: {
1742 t4: {
1743 ok: {
1744 a0: 〈0;X〉
1745 b0: 〈0;a1〉
1746 a1: (〈0;a0〉 + 2)
1747 b1: (〈0;b0〉 - 2)
1748 a0: 〈0;X〉
1749 X: 〈0;b1〉
1750 X: 5.0
1751 }
1752 }
1753 }
1754}
1755--- in.cue
1756{
1757 mutual: {
1758 t0: {
1759 ok: {
1760 c: (〈0;e〉 & {
1761 b: 2
1762 })
1763 e: {
1764 a: 1
1765 }
1766 e: 〈0;c〉
1767 }
1768 }
1769 }
1770 mutual: {
1771 t1: {
1772 ok: {
1773 a: {
1774 〈0;b〉
1775 b: {
1776 b: {
1777 f: 1
1778 }
1779 }
1780 }
1781 a: 〈0;a〉.b
1782 a: {
1783 b: {
1784 b: {
1785 f: 1
1786 }
1787 }
1788 }
1789 }
1790 }
1791 }
1792 mutual: {
1793 t2: {
1794 ok: {
1795 x: {
1796 a: {
1797 a: {
1798 f: 1
1799 }
1800 }
1801 }
1802 x: 〈0;y〉.a
1803 y: {
1804 a: {
1805 a: {
1806 e: 1
1807 }
1808 }
1809 }
1810 y: 〈0;x〉.a
1811 }
1812 }
1813 }
1814 mutual: {
1815 t3: {
1816 ok: {
1817 d: {
1818 e: {
1819 f: 1
1820 }
1821 }
1822 〈0;d〉
1823 d: {
1824 d: {
1825 e: {
1826 g: 1
1827 }
1828 }
1829 }
1830 }
1831 }
1832 }
1833 mutual: {
1834 t4: {
1835 ok: {
1836 p0: {
1837 z: 〈0;x〉.b
1838 x: {
1839 b: 〈1;y〉.c
1840 }
1841 x: {
1842 b: {
1843 d: {
1844 b: 2
1845 }
1846 }
1847 }
1848 y: {
1849 c: 〈1;z〉.d
1850 }
1851 z: {
1852 d: {
1853 a: 1
1854 }
1855 }
1856 }
1857 p1: {
1858 x: {
1859 b: 〈1;y〉.c
1860 }
1861 z: 〈0;x〉.b
1862 x: {
1863 b: {
1864 d: {
1865 b: 2
1866 }
1867 }
1868 }
1869 y: {
1870 c: 〈1;z〉.d
1871 }
1872 z: {
1873 d: {
1874 a: 1
1875 }
1876 }
1877 }
1878 p2: {
1879 x: {
1880 b: 〈1;y〉.c
1881 }
1882 x: {
1883 b: {
1884 d: {
1885 b: 2
1886 }
1887 }
1888 }
1889 y: {
1890 c: 〈1;z〉.d
1891 }
1892 z: 〈0;x〉.b
1893 z: {
1894 d: {
1895 a: 1
1896 }
1897 }
1898 }
1899 p3: {
1900 x: {
1901 b: {
1902 d: {
1903 b: 2
1904 }
1905 }
1906 }
1907 y: {
1908 c: 〈1;z〉.d
1909 }
1910 z: 〈0;x〉.b
1911 x: {
1912 b: 〈1;y〉.c
1913 }
1914 z: {
1915 d: {
1916 a: 1
1917 }
1918 }
1919 }
1920 p4: {
1921 z: 〈0;x〉.b
1922 x: {
1923 b: {
1924 d: {
1925 b: 2
1926 }
1927 }
1928 }
1929 y: {
1930 c: 〈1;z〉.d
1931 }
1932 x: {
1933 b: 〈1;y〉.c
1934 }
1935 z: {
1936 d: {
1937 a: 1
1938 }
1939 }
1940 }
1941 p5: {
1942 x: {
1943 b: {
1944 d: {
1945 b: 2
1946 }
1947 }
1948 }
1949 y: {
1950 c: 〈1;z〉.d
1951 }
1952 x: {
1953 b: 〈1;y〉.c
1954 }
1955 z: 〈0;x〉.b
1956 z: {
1957 d: {
1958 a: 1
1959 }
1960 }
1961 }
1962 check: ((((〈0;p1〉 & 〈0;p2〉) & 〈0;p3〉) & 〈0;p4〉) & 〈0;p5〉)
1963 }
1964 }
1965 }
1966}
View as plain text