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