cuelang.org/go@v0.13.0/cue/testdata/cycle/self.txtar (about) 1 -- in.cue -- 2 import "list" 3 4 expr: error1: { 5 a: 3 6 a: a + 1 7 } 8 expr: error2: { 9 a: a + 1 10 a: 3 11 } 12 listConcat: error1: { 13 a: ["1", "2"] 14 a: list.Concat([a, ["3"]]) 15 } 16 17 listConcat: error2: { 18 a: list.Concat([["3"], a]) 19 a: ["1", "2"] 20 } 21 22 selfEmbed: ok1: { 23 a: x 24 Y: x 25 x: {Y} 26 } 27 28 selfEmbed: ok2: { 29 Y: x.b 30 a: x 31 x: b: {Y} 32 } 33 34 selfEmbed: ok3: { 35 Y: x 36 a: x 37 x: {Y} 38 } 39 40 selfEmbed: ok4: { 41 a: x 42 x: {Y} 43 Y: x 44 } 45 46 selfEmbed: ok5: { 47 x: {Y} 48 a: x 49 Y: x 50 } 51 52 selfEmbed: ok6: { 53 x: b: {Y} 54 Y: x.b 55 a: x 56 } 57 58 59 disjSelf: ok1: { 60 #A: string | #A 61 x: #A 62 } 63 64 disjSelf: ok2: { 65 x: #A 66 #A: string | #A 67 } 68 69 disjSelf: ok3: { 70 #A: #A | string 71 x: #A 72 } 73 74 disjSelf: ok4: { 75 x: #A 76 #A: #A | string 77 } 78 79 disjEmbed: ok1: { 80 #A: string | {#A} 81 x: #A 82 } 83 84 disjEmbed: ok2: { 85 x: #A 86 #A: string | {#A} 87 } 88 89 disjEmbed: ok3: { 90 #A: {#A} | string 91 x: #A 92 } 93 94 disjEmbed: ok4: { 95 x: #A 96 #A: {#A} | string 97 } 98 99 // x and #A should yield the same result. 100 disjList: _ 101 disjList: ok1: { 102 #A: string | [#A] 103 x: #A 104 105 y: x 106 y: [[[[string]]]] 107 } 108 109 disjList: ok2: { 110 x: #A 111 #A: string | [#A] 112 } 113 114 disjList: ok3: { 115 #A: [#A] | string 116 x: #A 117 } 118 119 disjList: ok4: { 120 x: #A 121 #A: [#A] | string 122 } 123 124 name: "foo" 125 dynamicSelf: ok1: { 126 X=(name): string | X 127 x: X 128 } 129 130 dynamicSelf: ok2: { 131 x: X 132 X=(name): string | X 133 } 134 135 dynamicSelf: ok3: { 136 X=(name): X | string 137 x: X 138 } 139 140 dynamicSelf: ok4: { 141 x: X 142 X=(name): X | string 143 } 144 145 dynamicEmbed: ok1: { 146 X=(name): string | {X} 147 x: X 148 } 149 150 dynamicEmbed: ok2: { 151 x: X 152 X=(name): string | {X} 153 } 154 155 dynamicEmbed: ok3: { 156 X=(name): {X} | string 157 x: X 158 } 159 160 dynamicEmbed: ok4: { 161 x: X 162 X=(name): {X} | string 163 } 164 165 dynamicList: _ 166 dynamicList: ok1: { 167 X=(name): string | [X] 168 x: X 169 170 y: x 171 y: [[[[string]]]] 172 } 173 174 dynamicList: ok2: { 175 x: X 176 X=(name): string | [X] 177 } 178 179 dynamicList: ok3: { 180 X=(name): [X] | string 181 x: X 182 } 183 184 dynamicList: ok4: { 185 x: X 186 X=(name): [X] | string 187 } 188 189 dynamicPatternSelf: ok1: { X=[string]: string | X } 190 dynamicPatternSelf: ok2: { X=[string]: X | string } 191 dynamicPatternEmbed: ok1: { X=[string]: string | {X} } 192 dynamicPatternEmbed: ok2: { X=[string]: {X} | string } 193 dynamicPatternList: ok1: { X=[string]: string | [X] } 194 dynamicPatternList: ok2: { X=[string]: [X] | string } 195 196 valueSelf: ok1: { 197 y: X={string | X} 198 x: y 199 } 200 201 valueSelf: ok2: { 202 x: y 203 y: X={string | X} 204 } 205 206 valueSelf: ok3: { 207 y: X={X | string} 208 x: y 209 } 210 211 valueSelf: ok4: { 212 x: y 213 y: X={X | string} 214 } 215 216 valueEmbed: ok1: { 217 y: X={string | {X}} 218 x: y 219 } 220 221 valueEmbed: ok2: { 222 x: y 223 y: X={string | {X}} 224 } 225 226 valueEmbed: ok3: { 227 y: X={{X} | string} 228 x: y 229 } 230 231 valueEmbed: ok4: { 232 x: y 233 y: X={{X} | string} 234 } 235 236 valueList: ok1: { 237 y: X={string | [X]} 238 x: y 239 } 240 241 valueList: ok2: { 242 x: y 243 y: X={string | [X]} 244 } 245 246 valueList: ok3: { 247 y: X={[X] | string} 248 x: y 249 } 250 251 valueList: ok4: { 252 x: y 253 y: X={[X] | string} 254 } 255 256 // Issue #1729 257 issue1729: t1: { 258 #x: { #x | {} } 259 x: #x & {} 260 } 261 262 issue1729: t2: { 263 x: #x & {} 264 #x: { #x | {} } 265 } 266 267 -- out/eval/stats -- 268 Leaks: 0 269 Freed: 432 270 Reused: 423 271 Allocs: 9 272 Retain: 15 273 274 Unifications: 240 275 Conjuncts: 663 276 Disjuncts: 447 277 -- out/evalalpha -- 278 Errors: 279 expr.error1.a: conflicting values 4 and 3: 280 ./in.cue:4:5 281 ./in.cue:5:5 282 expr.error2.a: conflicting values 4 and 3: 283 ./in.cue:8:5 284 ./in.cue:9:5 285 0: structural cycle: 286 ./in.cue:13:5 287 1: structural cycle: 288 ./in.cue:17:5 289 290 Result: 291 (_|_){ 292 // [eval] 293 expr: (_|_){ 294 // [eval] 295 error1: (_|_){ 296 // [eval] 297 a: (_|_){ 298 // [eval] expr.error1.a: conflicting values 4 and 3: 299 // ./in.cue:4:5 300 // ./in.cue:5:5 301 } 302 } 303 error2: (_|_){ 304 // [eval] 305 a: (_|_){ 306 // [eval] expr.error2.a: conflicting values 4 and 3: 307 // ./in.cue:8:5 308 // ./in.cue:9:5 309 } 310 } 311 } 312 listConcat: (_|_){ 313 // [structural cycle] 314 error1: (_|_){ 315 // [structural cycle] 316 a: (_|_){ 317 // [structural cycle] 0: structural cycle: 318 // ./in.cue:13:5 319 } 320 } 321 error2: (_|_){ 322 // [structural cycle] 323 a: (_|_){ 324 // [structural cycle] 1: structural cycle: 325 // ./in.cue:17:5 326 } 327 } 328 } 329 selfEmbed: (struct){ 330 ok1: (struct){ 331 a: (struct){ 332 } 333 Y: (struct){ 334 } 335 x: (struct){ 336 } 337 } 338 ok2: (struct){ 339 Y: (struct){ 340 } 341 a: ~(selfEmbed.ok2.x) 342 x: (struct){ 343 b: (struct){ 344 } 345 } 346 } 347 ok3: (struct){ 348 Y: (struct){ 349 } 350 a: (struct){ 351 } 352 x: (struct){ 353 } 354 } 355 ok4: (struct){ 356 a: (struct){ 357 } 358 x: (struct){ 359 } 360 Y: (struct){ 361 } 362 } 363 ok5: (struct){ 364 x: (struct){ 365 } 366 a: (struct){ 367 } 368 Y: (struct){ 369 } 370 } 371 ok6: (struct){ 372 x: (struct){ 373 b: (struct){ 374 } 375 } 376 Y: (struct){ 377 } 378 a: ~(selfEmbed.ok6.x) 379 } 380 } 381 disjSelf: (struct){ 382 ok1: (struct){ 383 #A: (_){ |((string){ string }, (_){ _ }) } 384 x: (_){ |((string){ string }, (_){ _ }) } 385 } 386 ok2: (struct){ 387 x: (_){ |((string){ string }, (_){ _ }) } 388 #A: (_){ |((string){ string }, (_){ _ }) } 389 } 390 ok3: (struct){ 391 #A: (_){ |((_){ _ }, (string){ string }) } 392 x: (_){ |((_){ _ }, (string){ string }) } 393 } 394 ok4: (struct){ 395 x: (_){ |((_){ _ }, (string){ string }) } 396 #A: (_){ |((_){ _ }, (string){ string }) } 397 } 398 } 399 disjEmbed: (struct){ 400 ok1: (struct){ 401 #A: ((string|struct)){ |((string){ string }, (#struct){ 402 }) } 403 x: ((string|struct)){ |((string){ string }, (#struct){ 404 }) } 405 } 406 ok2: (struct){ 407 x: ((string|struct)){ |((string){ string }, (#struct){ 408 }) } 409 #A: ((string|struct)){ |((string){ string }, (#struct){ 410 }) } 411 } 412 ok3: (struct){ 413 #A: ((string|struct)){ |((#struct){ 414 }, (string){ string }) } 415 x: ((string|struct)){ |((#struct){ 416 }, (string){ string }) } 417 } 418 ok4: (struct){ 419 x: ((string|struct)){ |((#struct){ 420 }, (string){ string }) } 421 #A: ((string|struct)){ |((#struct){ 422 }, (string){ string }) } 423 } 424 } 425 disjList: (struct){ 426 ok1: (struct){ 427 #A: (string){ string } 428 x: (string){ string } 429 y: (#list){ 430 0: (#list){ 431 0: (#list){ 432 0: (#list){ 433 0: (string){ string } 434 } 435 } 436 } 437 } 438 } 439 ok2: (struct){ 440 x: (string){ string } 441 #A: (string){ string } 442 } 443 ok3: (struct){ 444 #A: (string){ string } 445 x: (string){ string } 446 } 447 ok4: (struct){ 448 x: (string){ string } 449 #A: (string){ string } 450 } 451 } 452 name: (string){ "foo" } 453 dynamicSelf: (struct){ 454 ok1: (struct){ 455 x: (_){ |((string){ string }, (_){ _ }) } 456 foo: (_){ |((string){ string }, (_){ _ }) } 457 } 458 ok2: (struct){ 459 x: (_){ |((string){ string }, (_){ _ }) } 460 foo: (_){ |((string){ string }, (_){ _ }) } 461 } 462 ok3: (struct){ 463 x: (_){ |((_){ _ }, (string){ string }) } 464 foo: (_){ |((_){ _ }, (string){ string }) } 465 } 466 ok4: (struct){ 467 x: (_){ |((_){ _ }, (string){ string }) } 468 foo: (_){ |((_){ _ }, (string){ string }) } 469 } 470 } 471 dynamicEmbed: (struct){ 472 ok1: (struct){ 473 x: ((string|struct)){ |((string){ string }, (struct){ 474 }) } 475 foo: ((string|struct)){ |((string){ string }, (struct){ 476 }) } 477 } 478 ok2: (struct){ 479 x: ((string|struct)){ |((string){ string }, (struct){ 480 }) } 481 foo: ((string|struct)){ |((string){ string }, (struct){ 482 }) } 483 } 484 ok3: (struct){ 485 x: ((string|struct)){ |((struct){ 486 }, (string){ string }) } 487 foo: ((string|struct)){ |((struct){ 488 }, (string){ string }) } 489 } 490 ok4: (struct){ 491 x: ((string|struct)){ |((struct){ 492 }, (string){ string }) } 493 foo: ((string|struct)){ |((struct){ 494 }, (string){ string }) } 495 } 496 } 497 dynamicList: (struct){ 498 ok1: (struct){ 499 x: (string){ string } 500 y: (#list){ 501 0: (#list){ 502 0: (#list){ 503 0: (#list){ 504 0: (string){ string } 505 } 506 } 507 } 508 } 509 foo: (string){ string } 510 } 511 ok2: (struct){ 512 x: (string){ string } 513 foo: (string){ string } 514 } 515 ok3: (struct){ 516 x: (string){ string } 517 foo: (string){ string } 518 } 519 ok4: (struct){ 520 x: (string){ string } 521 foo: (string){ string } 522 } 523 } 524 dynamicPatternSelf: (struct){ 525 ok1: (struct){ 526 } 527 ok2: (struct){ 528 } 529 } 530 dynamicPatternEmbed: (struct){ 531 ok1: (struct){ 532 } 533 ok2: (struct){ 534 } 535 } 536 dynamicPatternList: (struct){ 537 ok1: (struct){ 538 } 539 ok2: (struct){ 540 } 541 } 542 valueSelf: (struct){ 543 ok1: (struct){ 544 y: ((string|struct)){ |((string){ string }, (struct){ 545 }) } 546 x: ((string|struct)){ |((string){ string }, (struct){ 547 }) } 548 } 549 ok2: (struct){ 550 x: ((string|struct)){ |((string){ string }, (struct){ 551 }) } 552 y: ((string|struct)){ |((string){ string }, (struct){ 553 }) } 554 } 555 ok3: (struct){ 556 y: ((string|struct)){ |((struct){ 557 }, (string){ string }) } 558 x: ((string|struct)){ |((struct){ 559 }, (string){ string }) } 560 } 561 ok4: (struct){ 562 x: ((string|struct)){ |((struct){ 563 }, (string){ string }) } 564 y: ((string|struct)){ |((struct){ 565 }, (string){ string }) } 566 } 567 } 568 valueEmbed: (struct){ 569 ok1: (struct){ 570 y: ((string|struct)){ |((string){ string }, (struct){ 571 }) } 572 x: ((string|struct)){ |((string){ string }, (struct){ 573 }) } 574 } 575 ok2: (struct){ 576 x: ((string|struct)){ |((string){ string }, (struct){ 577 }) } 578 y: ((string|struct)){ |((string){ string }, (struct){ 579 }) } 580 } 581 ok3: (struct){ 582 y: ((string|struct)){ |((struct){ 583 }, (string){ string }) } 584 x: ((string|struct)){ |((struct){ 585 }, (string){ string }) } 586 } 587 ok4: (struct){ 588 x: ((string|struct)){ |((struct){ 589 }, (string){ string }) } 590 y: ((string|struct)){ |((struct){ 591 }, (string){ string }) } 592 } 593 } 594 valueList: (struct){ 595 ok1: (struct){ 596 y: (string){ string } 597 x: (string){ string } 598 } 599 ok2: (struct){ 600 x: (string){ string } 601 y: (string){ string } 602 } 603 ok3: (struct){ 604 y: (string){ string } 605 x: (string){ string } 606 } 607 ok4: (struct){ 608 x: (string){ string } 609 y: (string){ string } 610 } 611 } 612 issue1729: (struct){ 613 t1: (struct){ 614 #x: (#struct){ 615 } 616 x: (#struct){ 617 } 618 } 619 t2: (struct){ 620 x: (#struct){ 621 } 622 #x: (#struct){ 623 } 624 } 625 } 626 } 627 -- diff/-out/evalalpha<==>+out/eval -- 628 diff old new 629 --- old 630 +++ new 631 @@ -5,6 +5,10 @@ 632 expr.error2.a: conflicting values 4 and 3: 633 ./in.cue:8:5 634 ./in.cue:9:5 635 +0: structural cycle: 636 + ./in.cue:13:5 637 +1: structural cycle: 638 + ./in.cue:17:5 639 640 Result: 641 (_|_){ 642 @@ -33,17 +37,15 @@ 643 error1: (_|_){ 644 // [structural cycle] 645 a: (_|_){ 646 - // [structural cycle] 647 - 0: (string){ "1" } 648 - 1: (string){ "2" } 649 - } 650 - } 651 - error2: (_|_){ 652 - // [structural cycle] 653 - a: (_|_){ 654 - // [structural cycle] 655 - 0: (string){ "1" } 656 - 1: (string){ "2" } 657 + // [structural cycle] 0: structural cycle: 658 + // ./in.cue:13:5 659 + } 660 + } 661 + error2: (_|_){ 662 + // [structural cycle] 663 + a: (_|_){ 664 + // [structural cycle] 1: structural cycle: 665 + // ./in.cue:17:5 666 } 667 } 668 } 669 @@ -59,10 +61,7 @@ 670 ok2: (struct){ 671 Y: (struct){ 672 } 673 - a: (struct){ 674 - b: (struct){ 675 - } 676 - } 677 + a: ~(selfEmbed.ok2.x) 678 x: (struct){ 679 b: (struct){ 680 } 681 @@ -99,10 +98,7 @@ 682 } 683 Y: (struct){ 684 } 685 - a: (struct){ 686 - b: (struct){ 687 - } 688 - } 689 + a: ~(selfEmbed.ok6.x) 690 } 691 } 692 disjSelf: (struct){ 693 -- diff/todo/p3 -- 694 list.error*: different error messages. 695 -- out/eval -- 696 Errors: 697 expr.error1.a: conflicting values 4 and 3: 698 ./in.cue:4:5 699 ./in.cue:5:5 700 expr.error2.a: conflicting values 4 and 3: 701 ./in.cue:8:5 702 ./in.cue:9:5 703 704 Result: 705 (_|_){ 706 // [eval] 707 expr: (_|_){ 708 // [eval] 709 error1: (_|_){ 710 // [eval] 711 a: (_|_){ 712 // [eval] expr.error1.a: conflicting values 4 and 3: 713 // ./in.cue:4:5 714 // ./in.cue:5:5 715 } 716 } 717 error2: (_|_){ 718 // [eval] 719 a: (_|_){ 720 // [eval] expr.error2.a: conflicting values 4 and 3: 721 // ./in.cue:8:5 722 // ./in.cue:9:5 723 } 724 } 725 } 726 listConcat: (_|_){ 727 // [structural cycle] 728 error1: (_|_){ 729 // [structural cycle] 730 a: (_|_){ 731 // [structural cycle] 732 0: (string){ "1" } 733 1: (string){ "2" } 734 } 735 } 736 error2: (_|_){ 737 // [structural cycle] 738 a: (_|_){ 739 // [structural cycle] 740 0: (string){ "1" } 741 1: (string){ "2" } 742 } 743 } 744 } 745 selfEmbed: (struct){ 746 ok1: (struct){ 747 a: (struct){ 748 } 749 Y: (struct){ 750 } 751 x: (struct){ 752 } 753 } 754 ok2: (struct){ 755 Y: (struct){ 756 } 757 a: (struct){ 758 b: (struct){ 759 } 760 } 761 x: (struct){ 762 b: (struct){ 763 } 764 } 765 } 766 ok3: (struct){ 767 Y: (struct){ 768 } 769 a: (struct){ 770 } 771 x: (struct){ 772 } 773 } 774 ok4: (struct){ 775 a: (struct){ 776 } 777 x: (struct){ 778 } 779 Y: (struct){ 780 } 781 } 782 ok5: (struct){ 783 x: (struct){ 784 } 785 a: (struct){ 786 } 787 Y: (struct){ 788 } 789 } 790 ok6: (struct){ 791 x: (struct){ 792 b: (struct){ 793 } 794 } 795 Y: (struct){ 796 } 797 a: (struct){ 798 b: (struct){ 799 } 800 } 801 } 802 } 803 disjSelf: (struct){ 804 ok1: (struct){ 805 #A: (_){ |((string){ string }, (_){ _ }) } 806 x: (_){ |((string){ string }, (_){ _ }) } 807 } 808 ok2: (struct){ 809 x: (_){ |((string){ string }, (_){ _ }) } 810 #A: (_){ |((string){ string }, (_){ _ }) } 811 } 812 ok3: (struct){ 813 #A: (_){ |((_){ _ }, (string){ string }) } 814 x: (_){ |((_){ _ }, (string){ string }) } 815 } 816 ok4: (struct){ 817 x: (_){ |((_){ _ }, (string){ string }) } 818 #A: (_){ |((_){ _ }, (string){ string }) } 819 } 820 } 821 disjEmbed: (struct){ 822 ok1: (struct){ 823 #A: ((string|struct)){ |((string){ string }, (#struct){ 824 }) } 825 x: ((string|struct)){ |((string){ string }, (#struct){ 826 }) } 827 } 828 ok2: (struct){ 829 x: ((string|struct)){ |((string){ string }, (#struct){ 830 }) } 831 #A: ((string|struct)){ |((string){ string }, (#struct){ 832 }) } 833 } 834 ok3: (struct){ 835 #A: ((string|struct)){ |((#struct){ 836 }, (string){ string }) } 837 x: ((string|struct)){ |((#struct){ 838 }, (string){ string }) } 839 } 840 ok4: (struct){ 841 x: ((string|struct)){ |((#struct){ 842 }, (string){ string }) } 843 #A: ((string|struct)){ |((#struct){ 844 }, (string){ string }) } 845 } 846 } 847 disjList: (struct){ 848 ok1: (struct){ 849 #A: (string){ string } 850 x: (string){ string } 851 y: (#list){ 852 0: (#list){ 853 0: (#list){ 854 0: (#list){ 855 0: (string){ string } 856 } 857 } 858 } 859 } 860 } 861 ok2: (struct){ 862 x: (string){ string } 863 #A: (string){ string } 864 } 865 ok3: (struct){ 866 #A: (string){ string } 867 x: (string){ string } 868 } 869 ok4: (struct){ 870 x: (string){ string } 871 #A: (string){ string } 872 } 873 } 874 name: (string){ "foo" } 875 dynamicSelf: (struct){ 876 ok1: (struct){ 877 x: (_){ |((string){ string }, (_){ _ }) } 878 foo: (_){ |((string){ string }, (_){ _ }) } 879 } 880 ok2: (struct){ 881 x: (_){ |((string){ string }, (_){ _ }) } 882 foo: (_){ |((string){ string }, (_){ _ }) } 883 } 884 ok3: (struct){ 885 x: (_){ |((_){ _ }, (string){ string }) } 886 foo: (_){ |((_){ _ }, (string){ string }) } 887 } 888 ok4: (struct){ 889 x: (_){ |((_){ _ }, (string){ string }) } 890 foo: (_){ |((_){ _ }, (string){ string }) } 891 } 892 } 893 dynamicEmbed: (struct){ 894 ok1: (struct){ 895 x: ((string|struct)){ |((string){ string }, (struct){ 896 }) } 897 foo: ((string|struct)){ |((string){ string }, (struct){ 898 }) } 899 } 900 ok2: (struct){ 901 x: ((string|struct)){ |((string){ string }, (struct){ 902 }) } 903 foo: ((string|struct)){ |((string){ string }, (struct){ 904 }) } 905 } 906 ok3: (struct){ 907 x: ((string|struct)){ |((struct){ 908 }, (string){ string }) } 909 foo: ((string|struct)){ |((struct){ 910 }, (string){ string }) } 911 } 912 ok4: (struct){ 913 x: ((string|struct)){ |((struct){ 914 }, (string){ string }) } 915 foo: ((string|struct)){ |((struct){ 916 }, (string){ string }) } 917 } 918 } 919 dynamicList: (struct){ 920 ok1: (struct){ 921 x: (string){ string } 922 y: (#list){ 923 0: (#list){ 924 0: (#list){ 925 0: (#list){ 926 0: (string){ string } 927 } 928 } 929 } 930 } 931 foo: (string){ string } 932 } 933 ok2: (struct){ 934 x: (string){ string } 935 foo: (string){ string } 936 } 937 ok3: (struct){ 938 x: (string){ string } 939 foo: (string){ string } 940 } 941 ok4: (struct){ 942 x: (string){ string } 943 foo: (string){ string } 944 } 945 } 946 dynamicPatternSelf: (struct){ 947 ok1: (struct){ 948 } 949 ok2: (struct){ 950 } 951 } 952 dynamicPatternEmbed: (struct){ 953 ok1: (struct){ 954 } 955 ok2: (struct){ 956 } 957 } 958 dynamicPatternList: (struct){ 959 ok1: (struct){ 960 } 961 ok2: (struct){ 962 } 963 } 964 valueSelf: (struct){ 965 ok1: (struct){ 966 y: ((string|struct)){ |((string){ string }, (struct){ 967 }) } 968 x: ((string|struct)){ |((string){ string }, (struct){ 969 }) } 970 } 971 ok2: (struct){ 972 x: ((string|struct)){ |((string){ string }, (struct){ 973 }) } 974 y: ((string|struct)){ |((string){ string }, (struct){ 975 }) } 976 } 977 ok3: (struct){ 978 y: ((string|struct)){ |((struct){ 979 }, (string){ string }) } 980 x: ((string|struct)){ |((struct){ 981 }, (string){ string }) } 982 } 983 ok4: (struct){ 984 x: ((string|struct)){ |((struct){ 985 }, (string){ string }) } 986 y: ((string|struct)){ |((struct){ 987 }, (string){ string }) } 988 } 989 } 990 valueEmbed: (struct){ 991 ok1: (struct){ 992 y: ((string|struct)){ |((string){ string }, (struct){ 993 }) } 994 x: ((string|struct)){ |((string){ string }, (struct){ 995 }) } 996 } 997 ok2: (struct){ 998 x: ((string|struct)){ |((string){ string }, (struct){ 999 }) } 1000 y: ((string|struct)){ |((string){ string }, (struct){ 1001 }) } 1002 } 1003 ok3: (struct){ 1004 y: ((string|struct)){ |((struct){ 1005 }, (string){ string }) } 1006 x: ((string|struct)){ |((struct){ 1007 }, (string){ string }) } 1008 } 1009 ok4: (struct){ 1010 x: ((string|struct)){ |((struct){ 1011 }, (string){ string }) } 1012 y: ((string|struct)){ |((struct){ 1013 }, (string){ string }) } 1014 } 1015 } 1016 valueList: (struct){ 1017 ok1: (struct){ 1018 y: (string){ string } 1019 x: (string){ string } 1020 } 1021 ok2: (struct){ 1022 x: (string){ string } 1023 y: (string){ string } 1024 } 1025 ok3: (struct){ 1026 y: (string){ string } 1027 x: (string){ string } 1028 } 1029 ok4: (struct){ 1030 x: (string){ string } 1031 y: (string){ string } 1032 } 1033 } 1034 issue1729: (struct){ 1035 t1: (struct){ 1036 #x: (#struct){ 1037 } 1038 x: (#struct){ 1039 } 1040 } 1041 t2: (struct){ 1042 x: (#struct){ 1043 } 1044 #x: (#struct){ 1045 } 1046 } 1047 } 1048 } 1049 -- out/compile -- 1050 --- in.cue 1051 { 1052 expr: { 1053 error1: { 1054 a: 3 1055 a: (〈0;a〉 + 1) 1056 } 1057 } 1058 expr: { 1059 error2: { 1060 a: (〈0;a〉 + 1) 1061 a: 3 1062 } 1063 } 1064 listConcat: { 1065 error1: { 1066 a: [ 1067 "1", 1068 "2", 1069 ] 1070 a: 〈import;list〉.Concat([ 1071 〈1;a〉, 1072 [ 1073 "3", 1074 ], 1075 ]) 1076 } 1077 } 1078 listConcat: { 1079 error2: { 1080 a: 〈import;list〉.Concat([ 1081 [ 1082 "3", 1083 ], 1084 〈1;a〉, 1085 ]) 1086 a: [ 1087 "1", 1088 "2", 1089 ] 1090 } 1091 } 1092 selfEmbed: { 1093 ok1: { 1094 a: 〈0;x〉 1095 Y: 〈0;x〉 1096 x: { 1097 〈1;Y〉 1098 } 1099 } 1100 } 1101 selfEmbed: { 1102 ok2: { 1103 Y: 〈0;x〉.b 1104 a: 〈0;x〉 1105 x: { 1106 b: { 1107 〈2;Y〉 1108 } 1109 } 1110 } 1111 } 1112 selfEmbed: { 1113 ok3: { 1114 Y: 〈0;x〉 1115 a: 〈0;x〉 1116 x: { 1117 〈1;Y〉 1118 } 1119 } 1120 } 1121 selfEmbed: { 1122 ok4: { 1123 a: 〈0;x〉 1124 x: { 1125 〈1;Y〉 1126 } 1127 Y: 〈0;x〉 1128 } 1129 } 1130 selfEmbed: { 1131 ok5: { 1132 x: { 1133 〈1;Y〉 1134 } 1135 a: 〈0;x〉 1136 Y: 〈0;x〉 1137 } 1138 } 1139 selfEmbed: { 1140 ok6: { 1141 x: { 1142 b: { 1143 〈2;Y〉 1144 } 1145 } 1146 Y: 〈0;x〉.b 1147 a: 〈0;x〉 1148 } 1149 } 1150 disjSelf: { 1151 ok1: { 1152 #A: (string|〈0;#A〉) 1153 x: 〈0;#A〉 1154 } 1155 } 1156 disjSelf: { 1157 ok2: { 1158 x: 〈0;#A〉 1159 #A: (string|〈0;#A〉) 1160 } 1161 } 1162 disjSelf: { 1163 ok3: { 1164 #A: (〈0;#A〉|string) 1165 x: 〈0;#A〉 1166 } 1167 } 1168 disjSelf: { 1169 ok4: { 1170 x: 〈0;#A〉 1171 #A: (〈0;#A〉|string) 1172 } 1173 } 1174 disjEmbed: { 1175 ok1: { 1176 #A: (string|{ 1177 〈1;#A〉 1178 }) 1179 x: 〈0;#A〉 1180 } 1181 } 1182 disjEmbed: { 1183 ok2: { 1184 x: 〈0;#A〉 1185 #A: (string|{ 1186 〈1;#A〉 1187 }) 1188 } 1189 } 1190 disjEmbed: { 1191 ok3: { 1192 #A: ({ 1193 〈1;#A〉 1194 }|string) 1195 x: 〈0;#A〉 1196 } 1197 } 1198 disjEmbed: { 1199 ok4: { 1200 x: 〈0;#A〉 1201 #A: ({ 1202 〈1;#A〉 1203 }|string) 1204 } 1205 } 1206 disjList: _ 1207 disjList: { 1208 ok1: { 1209 #A: (string|[ 1210 〈1;#A〉, 1211 ]) 1212 x: 〈0;#A〉 1213 y: 〈0;x〉 1214 y: [ 1215 [ 1216 [ 1217 [ 1218 string, 1219 ], 1220 ], 1221 ], 1222 ] 1223 } 1224 } 1225 disjList: { 1226 ok2: { 1227 x: 〈0;#A〉 1228 #A: (string|[ 1229 〈1;#A〉, 1230 ]) 1231 } 1232 } 1233 disjList: { 1234 ok3: { 1235 #A: ([ 1236 〈1;#A〉, 1237 ]|string) 1238 x: 〈0;#A〉 1239 } 1240 } 1241 disjList: { 1242 ok4: { 1243 x: 〈0;#A〉 1244 #A: ([ 1245 〈1;#A〉, 1246 ]|string) 1247 } 1248 } 1249 name: "foo" 1250 dynamicSelf: { 1251 ok1: { 1252 〈2;name〉: (string|〈0;(〈2;name〉)〉) 1253 x: 〈0;(〈2;name〉)〉 1254 } 1255 } 1256 dynamicSelf: { 1257 ok2: { 1258 x: 〈0;(〈2;name〉)〉 1259 〈2;name〉: (string|〈0;(〈2;name〉)〉) 1260 } 1261 } 1262 dynamicSelf: { 1263 ok3: { 1264 〈2;name〉: (〈0;(〈2;name〉)〉|string) 1265 x: 〈0;(〈2;name〉)〉 1266 } 1267 } 1268 dynamicSelf: { 1269 ok4: { 1270 x: 〈0;(〈2;name〉)〉 1271 〈2;name〉: (〈0;(〈2;name〉)〉|string) 1272 } 1273 } 1274 dynamicEmbed: { 1275 ok1: { 1276 〈2;name〉: (string|{ 1277 〈1;(〈2;name〉)〉 1278 }) 1279 x: 〈0;(〈2;name〉)〉 1280 } 1281 } 1282 dynamicEmbed: { 1283 ok2: { 1284 x: 〈0;(〈2;name〉)〉 1285 〈2;name〉: (string|{ 1286 〈1;(〈2;name〉)〉 1287 }) 1288 } 1289 } 1290 dynamicEmbed: { 1291 ok3: { 1292 〈2;name〉: ({ 1293 〈1;(〈2;name〉)〉 1294 }|string) 1295 x: 〈0;(〈2;name〉)〉 1296 } 1297 } 1298 dynamicEmbed: { 1299 ok4: { 1300 x: 〈0;(〈2;name〉)〉 1301 〈2;name〉: ({ 1302 〈1;(〈2;name〉)〉 1303 }|string) 1304 } 1305 } 1306 dynamicList: _ 1307 dynamicList: { 1308 ok1: { 1309 〈2;name〉: (string|[ 1310 〈1;(〈2;name〉)〉, 1311 ]) 1312 x: 〈0;(〈2;name〉)〉 1313 y: 〈0;x〉 1314 y: [ 1315 [ 1316 [ 1317 [ 1318 string, 1319 ], 1320 ], 1321 ], 1322 ] 1323 } 1324 } 1325 dynamicList: { 1326 ok2: { 1327 x: 〈0;(〈2;name〉)〉 1328 〈2;name〉: (string|[ 1329 〈1;(〈2;name〉)〉, 1330 ]) 1331 } 1332 } 1333 dynamicList: { 1334 ok3: { 1335 〈2;name〉: ([ 1336 〈1;(〈2;name〉)〉, 1337 ]|string) 1338 x: 〈0;(〈2;name〉)〉 1339 } 1340 } 1341 dynamicList: { 1342 ok4: { 1343 x: 〈0;(〈2;name〉)〉 1344 〈2;name〉: ([ 1345 〈1;(〈2;name〉)〉, 1346 ]|string) 1347 } 1348 } 1349 dynamicPatternSelf: { 1350 ok1: { 1351 [string]: (string|〈0;(〈0;-〉)〉) 1352 } 1353 } 1354 dynamicPatternSelf: { 1355 ok2: { 1356 [string]: (〈0;(〈0;-〉)〉|string) 1357 } 1358 } 1359 dynamicPatternEmbed: { 1360 ok1: { 1361 [string]: (string|{ 1362 〈1;(〈0;-〉)〉 1363 }) 1364 } 1365 } 1366 dynamicPatternEmbed: { 1367 ok2: { 1368 [string]: ({ 1369 〈1;(〈0;-〉)〉 1370 }|string) 1371 } 1372 } 1373 dynamicPatternList: { 1374 ok1: { 1375 [string]: (string|[ 1376 〈1;(〈0;-〉)〉, 1377 ]) 1378 } 1379 } 1380 dynamicPatternList: { 1381 ok2: { 1382 [string]: ([ 1383 〈1;(〈0;-〉)〉, 1384 ]|string) 1385 } 1386 } 1387 valueSelf: { 1388 ok1: { 1389 y: { 1390 (string|〈1〉) 1391 } 1392 x: 〈0;y〉 1393 } 1394 } 1395 valueSelf: { 1396 ok2: { 1397 x: 〈0;y〉 1398 y: { 1399 (string|〈1〉) 1400 } 1401 } 1402 } 1403 valueSelf: { 1404 ok3: { 1405 y: { 1406 (〈1〉|string) 1407 } 1408 x: 〈0;y〉 1409 } 1410 } 1411 valueSelf: { 1412 ok4: { 1413 x: 〈0;y〉 1414 y: { 1415 (〈1〉|string) 1416 } 1417 } 1418 } 1419 valueEmbed: { 1420 ok1: { 1421 y: { 1422 (string|{ 1423 〈2〉 1424 }) 1425 } 1426 x: 〈0;y〉 1427 } 1428 } 1429 valueEmbed: { 1430 ok2: { 1431 x: 〈0;y〉 1432 y: { 1433 (string|{ 1434 〈2〉 1435 }) 1436 } 1437 } 1438 } 1439 valueEmbed: { 1440 ok3: { 1441 y: { 1442 ({ 1443 〈2〉 1444 }|string) 1445 } 1446 x: 〈0;y〉 1447 } 1448 } 1449 valueEmbed: { 1450 ok4: { 1451 x: 〈0;y〉 1452 y: { 1453 ({ 1454 〈2〉 1455 }|string) 1456 } 1457 } 1458 } 1459 valueList: { 1460 ok1: { 1461 y: { 1462 (string|[ 1463 〈2〉, 1464 ]) 1465 } 1466 x: 〈0;y〉 1467 } 1468 } 1469 valueList: { 1470 ok2: { 1471 x: 〈0;y〉 1472 y: { 1473 (string|[ 1474 〈2〉, 1475 ]) 1476 } 1477 } 1478 } 1479 valueList: { 1480 ok3: { 1481 y: { 1482 ([ 1483 〈2〉, 1484 ]|string) 1485 } 1486 x: 〈0;y〉 1487 } 1488 } 1489 valueList: { 1490 ok4: { 1491 x: 〈0;y〉 1492 y: { 1493 ([ 1494 〈2〉, 1495 ]|string) 1496 } 1497 } 1498 } 1499 issue1729: { 1500 t1: { 1501 #x: { 1502 (〈1;#x〉|{}) 1503 } 1504 x: (〈0;#x〉 & {}) 1505 } 1506 } 1507 issue1729: { 1508 t2: { 1509 x: (〈0;#x〉 & {}) 1510 #x: { 1511 (〈1;#x〉|{}) 1512 } 1513 } 1514 } 1515 }