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