cuelang.org/go@v0.10.1/cue/testdata/cycle/comprehension.txtar (about) 1 -- in.cue -- 2 // Allow lookup in partially evaluated struct as long as the end result is 3 // concrete. 4 A: { 5 a: { 6 parent: "" 7 children: [for k, v in A if v.parent == k {k}] 8 } 9 b: { 10 parent: "a" 11 children: [for k, v in A if v.parent == k {k}] 12 } 13 } 14 15 // This should result in an incomplete error (a reference cycle error classifies 16 // as incomplete). 17 B: { 18 a: { 19 parent: "" 20 children: [for k, v in B for _, w in v.children {k}] 21 } 22 } 23 24 // Issue #486 25 Issue486: { 26 A: { 27 a: { 28 parent: "" 29 children: [...string] 30 } 31 b: { 32 parent: "a" 33 children: [...string] 34 } 35 c: { 36 parent: "b" 37 children: [...string] 38 } 39 } 40 41 A: [Name=string]: { 42 children: [ 43 for k, v in A 44 if v.parent == Name { 45 k 46 }, 47 ] 48 } 49 } 50 51 // Issue #1666 52 issue1666: { 53 #E: { 54 f1: [string]: #E | [...#E] 55 f2: [string]: t: #E 56 } 57 58 _e: #E 59 _e: f2: a: _ 60 61 e: _e & { 62 f1: { 63 for fk, s in _e.f2 { 64 (fk): s.t 65 } 66 } 67 } 68 } 69 70 // Issue #779: bidirectional projection 71 // Should be allowed as long as the set of fields is not modified as a result 72 // of a comprehension. 73 issue779: { 74 X: Y.message 75 STATE: { 76 for k, v in Y { 77 if k != "message" { 78 "\(k)": v 79 } 80 } 81 } 82 Y: STATE & { message: X } 83 X: "test" 84 STATE: { code: 101 } 85 } 86 87 // Comprehension ends up inserting in the same arcs over which it 88 // is iterating. This is fine as long as the set is not altered. 89 // Issue #1934 90 selfReferential: T1: { 91 S: d: "bar" 92 93 T: e: S: a: "foo" 94 95 for s, v in S for t, _ in T { 96 T: (t): S: (s): v 97 } 98 } 99 100 // selfReferential comprehenion for list. 101 // Issue #1934 102 selfReferential: list: { 103 panels: [ 104 for i, _ in panels { 105 id: i 106 } 107 ] 108 panels: [{}, {}, {}] 109 } 110 111 selfReferential: insertionError: { 112 A: { 113 foo: 1 114 for x in A { 115 // May not insert foo3. Use dynamic references to force the 116 // comprehension to be evaluated in the struct in which it is 117 // defined. 118 ("foo3"): 1 119 } 120 } 121 } 122 123 // A comprehension should not recursively evaluated arcs, so that a 124 // structural cycle can be avoided when unnecessary. 125 selfReferential: acrossOr: t1: p1: { 126 o: #Output & { retry: reject: "ok" } 127 128 #AllOutputs: { 129 reject: string 130 resource: string 131 retry: #Output 132 } 133 134 #Output: or([for name, config in #AllOutputs { 135 (name): config 136 }]) 137 } 138 139 selfReferential: acrossOr: t1: p2: { 140 #Output: or([for name, config in #AllOutputs { 141 (name): config 142 }]) 143 144 o: #Output & { retry: reject: "ok" } 145 146 #AllOutputs: { 147 reject: string 148 resource: string 149 retry: #Output 150 } 151 } 152 153 selfReferential: acrossOr: t1: p3: { 154 #Output: or([for name, config in #AllOutputs { 155 (name): config 156 }]) 157 158 #AllOutputs: { 159 reject: string 160 resource: string 161 retry: #Output 162 } 163 164 o: #Output & { retry: reject: "ok" } 165 } 166 167 selfReferential: acrossOr: t2: p1: { 168 d: or([for x, y in #A { y }]) 169 o: d & { b: 2 } 170 #A: { 171 d1: int 172 d2: string 173 d3: b: d 174 } 175 } 176 177 selfReferential: acrossOr: t2: p2: { 178 o: d & { b: 2 } 179 d: or([for x, y in #A { y }]) 180 #A: { 181 d1: int 182 d2: string 183 d3: b: d 184 } 185 } 186 187 selfReferential: acrossOr: t2: p3: { 188 o: d & { b: 2 } 189 #A: { 190 d1: int 191 d2: string 192 d3: b: d 193 } 194 d: or([for x, y in #A { y }]) 195 } 196 197 issue1881: p1: { 198 o: #Output & { retry: output: reject: "ok" } 199 200 #AllOutputs: { 201 reject: string 202 resource: string 203 retry: output: #Output 204 } 205 206 #Output: or([for name, config in #AllOutputs { 207 (name): config 208 }]) 209 } 210 211 issue1881: p2: { 212 #AllOutputs: { 213 reject: string 214 resource: string 215 retry: output: #Output 216 } 217 218 o: #Output & { retry: output: reject: "ok" } 219 220 #Output: or([for name, config in #AllOutputs { 221 (name): config 222 }]) 223 } 224 225 issue1881: p3: { 226 #AllOutputs: { 227 reject: string 228 resource: string 229 retry: output: #Output 230 } 231 232 #Output: or([for name, config in #AllOutputs { 233 (name): config 234 }]) 235 236 o: #Output & { retry: output: reject: "ok" } 237 } 238 239 siblingInsertion: t1: p1: { 240 D: "logging": _ 241 deployment: _ 242 243 for k, v in deployment 244 for k1, v2 in v.env2 { 245 deployment: (k): env: (k1): v2 246 } 247 248 for id, v in D { 249 deployment: (id): env2: ENV: "True" 250 } 251 } 252 253 siblingInsertion: t1: p2: { 254 D: "logging": _ 255 deployment: _ 256 257 for id, v in D { 258 deployment: (id): env2: ENV: "True" 259 } 260 261 for k, v in deployment 262 for k1, v2 in v.env2 { 263 deployment: (k): env: (k1): v2 264 } 265 } 266 267 siblingInsertion: t2: p1: { 268 D: "logging": _ 269 deployment: _ 270 271 for k, v in deployment { 272 for k1, v2 in v.env2 { 273 deployment: (k): env: (k1): v2 274 } 275 } 276 277 for id, v in D { 278 deployment: (id): env2: ENV: "True" 279 } 280 } 281 282 siblingInsertion: t2: p2: { 283 D: "logging": _ 284 deployment: _ 285 286 for k, v in deployment { 287 for k1, v2 in v.env2 { 288 deployment: (k): env: (k1): v2 289 } 290 } 291 292 for id, v in D { 293 deployment: (id): env2: ENV: "True" 294 } 295 } 296 297 // Issue #1407 298 // Ensure there is a useful error message. 299 selfReferential: fail: { 300 a: {} 301 b: a.x != "" 302 if b { 303 } 304 } 305 306 // avoid infinite recursion 307 issue2367: { 308 a: _ 309 for x in [a] {a: x} 310 } 311 312 -- out/evalalpha/stats -- 313 Leaks: 431 314 Freed: 12 315 Reused: 12 316 Allocs: 431 317 Retain: 0 318 319 Unifications: 397 320 Conjuncts: 2202 321 Disjuncts: 36 322 -- out/evalalpha -- 323 Errors: 324 issue1881.p1.o.retry: field not allowed: 325 ./in.cue:197:17 326 selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 327 ./in.cue:125:17 328 selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced: 329 ./in.cue:117:14 330 selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 331 ./in.cue:133:14 332 selfReferential.acrossOr.t1.p1.2.retry: structural cycle: 333 ./in.cue:133:14 334 selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 335 ./in.cue:139:11 336 ./in.cue:143:17 337 selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 338 ./in.cue:139:14 339 selfReferential.acrossOr.t1.p2.2.retry: structural cycle: 340 ./in.cue:139:14 341 selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 342 ./in.cue:153:11 343 ./in.cue:163:17 344 selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 345 ./in.cue:153:14 346 selfReferential.acrossOr.t2.p1.2.b: structural cycle: 347 ./in.cue:167:8 348 selfReferential.acrossOr.t2.p2.2.b: structural cycle: 349 ./in.cue:178:8 350 selfReferential.acrossOr.t2.p3.2.b: structural cycle: 351 ./in.cue:193:8 352 issue1881.p1.0.reject: structural cycle: 353 ./in.cue:205:14 354 issue1881.p1.2.retry.output: structural cycle: 355 ./in.cue:205:14 356 issue1881.p2.o.retry: field not allowed: 357 ./in.cue:219:11 358 ./in.cue:217:17 359 issue1881.p2.2.retry: structural cycle: 360 ./in.cue:219:14 361 issue1881.p3.o.retry: field not allowed: 362 ./in.cue:231:11 363 ./in.cue:235:17 364 issue1881.p3.2.retry: structural cycle: 365 ./in.cue:231:14 366 siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 367 ./in.cue:277:21 368 siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 369 ./in.cue:292:21 370 issue2367.0: structural cycle: 371 ./in.cue:308:11 372 373 Result: 374 (_|_){ 375 // [eval] 376 A: (struct){ 377 a: (struct){ 378 parent: (string){ "" } 379 children: (#list){ 380 } 381 } 382 b: (struct){ 383 parent: (string){ "a" } 384 children: (#list){ 385 } 386 } 387 } 388 B: (struct){ 389 a: (struct){ 390 parent: (string){ "" } 391 children: (_|_){ 392 // [incomplete] B.a.children: cannot range over v.children (incomplete type _): 393 // ./in.cue:19:40 394 } 395 } 396 } 397 Issue486: (struct){ 398 A: (struct){ 399 a: (struct){ 400 parent: (string){ "" } 401 children: (#list){ 402 0: (string){ "b" } 403 } 404 } 405 b: (struct){ 406 parent: (string){ "a" } 407 children: (#list){ 408 0: (string){ "c" } 409 } 410 } 411 c: (struct){ 412 parent: (string){ "b" } 413 children: (#list){ 414 } 415 } 416 } 417 } 418 issue1666: (struct){ 419 #E: (#struct){ 420 f1: (#struct){ 421 } 422 f2: (#struct){ 423 } 424 } 425 _e: (#struct){ 426 f2: (#struct){ 427 a: (#struct){ 428 t: (#struct){ 429 f1: (#struct){ 430 } 431 f2: (#struct){ 432 } 433 } 434 } 435 } 436 f1: (#struct){ 437 } 438 } 439 e: (#struct){ 440 f1: (#struct){ 441 a: (#struct){ 442 f1: (#struct){ 443 } 444 f2: (#struct){ 445 } 446 } 447 } 448 f2: (#struct){ 449 a: (#struct){ 450 t: (#struct){ 451 f1: (#struct){ 452 } 453 f2: (#struct){ 454 } 455 } 456 } 457 } 458 } 459 } 460 issue779: (struct){ 461 X: (string){ "test" } 462 STATE: (struct){ 463 code: (int){ 101 } 464 } 465 Y: (struct){ 466 message: (string){ "test" } 467 code: (int){ 101 } 468 } 469 } 470 selfReferential: (_|_){ 471 // [eval] 472 T1: (struct){ 473 S: (struct){ 474 d: (string){ "bar" } 475 } 476 T: (struct){ 477 e: (struct){ 478 S: (struct){ 479 a: (string){ "foo" } 480 d: (string){ "bar" } 481 } 482 } 483 } 484 } 485 list: (struct){ 486 panels: (_|_){ 487 // [incomplete] selfReferential.list.panels: cannot range over panels (incomplete type _): 488 // ./in.cue:103:15 489 0: (struct){ 490 } 491 1: (struct){ 492 } 493 2: (struct){ 494 } 495 } 496 } 497 insertionError: (_|_){ 498 // [eval] 499 A: (_|_){ 500 // [eval] selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced: 501 // ./in.cue:117:14 502 foo: (int){ 1 } 503 } 504 } 505 acrossOr: (_|_){ 506 // [eval] 507 t1: (_|_){ 508 // [eval] 509 p1: (_|_){ 510 // [eval] 511 o: (_|_){ 512 // [eval] selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 513 // ./in.cue:125:17 514 // selfReferential.acrossOr.t1.p1.2.retry: structural cycle: 515 // ./in.cue:133:14 516 retry: (_|_){ 517 // [eval] selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 518 // ./in.cue:125:17 519 } 520 } 521 #AllOutputs: (_|_){ 522 // [structural cycle] 523 reject: (string){ string } 524 resource: (string){ string } 525 retry: (_|_){ 526 // [structural cycle] selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 527 // ./in.cue:133:14 528 } 529 } 530 #Output: (_|_){ 531 // [structural cycle] selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 532 // ./in.cue:133:14 533 } 534 } 535 p2: (_|_){ 536 // [eval] 537 #Output: (_|_){ 538 // [structural cycle] selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 539 // ./in.cue:139:14 540 } 541 o: (_|_){ 542 // [eval] selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 543 // ./in.cue:139:11 544 // ./in.cue:143:17 545 // selfReferential.acrossOr.t1.p2.2.retry: structural cycle: 546 // ./in.cue:139:14 547 retry: (_|_){ 548 // [eval] selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 549 // ./in.cue:139:11 550 // ./in.cue:143:17 551 } 552 } 553 #AllOutputs: (_|_){ 554 // [structural cycle] 555 reject: (string){ string } 556 resource: (string){ string } 557 retry: (_|_){ 558 // [structural cycle] selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 559 // ./in.cue:139:14 560 } 561 } 562 } 563 p3: (_|_){ 564 // [eval] 565 #Output: (_|_){ 566 // [structural cycle] selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 567 // ./in.cue:153:14 568 } 569 #AllOutputs: (_|_){ 570 // [structural cycle] 571 reject: (string){ string } 572 resource: (string){ string } 573 retry: (_|_){ 574 // [structural cycle] selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 575 // ./in.cue:153:14 576 } 577 } 578 o: (_|_){ 579 // [eval] selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 580 // ./in.cue:153:11 581 // ./in.cue:163:17 582 // selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 583 // ./in.cue:153:14 584 retry: (_|_){ 585 // [eval] selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 586 // ./in.cue:153:11 587 // ./in.cue:163:17 588 } 589 } 590 } 591 } 592 t2: (_|_){ 593 // [structural cycle] 594 p1: (_|_){ 595 // [structural cycle] 596 d: (_|_){ 597 // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 598 // ./in.cue:167:8 599 } 600 o: (_|_){ 601 // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 602 // ./in.cue:167:8 603 } 604 #A: (_|_){ 605 // [structural cycle] 606 d1: (int){ int } 607 d2: (string){ string } 608 d3: (_|_){ 609 // [structural cycle] 610 b: (_|_){ 611 // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 612 // ./in.cue:167:8 613 } 614 } 615 } 616 } 617 p2: (_|_){ 618 // [structural cycle] 619 o: (_|_){ 620 // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 621 // ./in.cue:178:8 622 } 623 d: (_|_){ 624 // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 625 // ./in.cue:178:8 626 } 627 #A: (_|_){ 628 // [structural cycle] 629 d1: (int){ int } 630 d2: (string){ string } 631 d3: (_|_){ 632 // [structural cycle] 633 b: (_|_){ 634 // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 635 // ./in.cue:178:8 636 } 637 } 638 } 639 } 640 p3: (_|_){ 641 // [structural cycle] 642 o: (_|_){ 643 // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 644 // ./in.cue:193:8 645 } 646 #A: (_|_){ 647 // [structural cycle] 648 d1: (int){ int } 649 d2: (string){ string } 650 d3: (_|_){ 651 // [structural cycle] 652 b: (_|_){ 653 // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 654 // ./in.cue:193:8 655 } 656 } 657 } 658 d: (_|_){ 659 // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 660 // ./in.cue:193:8 661 } 662 } 663 } 664 } 665 fail: (_|_){ 666 // [incomplete] selfReferential.fail.b: undefined field: x: 667 // ./in.cue:300:7 668 a: (struct){ 669 } 670 b: (_|_){ 671 // [incomplete] selfReferential.fail.b: undefined field: x: 672 // ./in.cue:300:7 673 } 674 } 675 } 676 issue1881: (_|_){ 677 // [eval] 678 p1: (_|_){ 679 // [eval] 680 o: (_|_){ 681 // [eval] issue1881.p1.o.retry: field not allowed: 682 // ./in.cue:197:17 683 // issue1881.p1.2.retry.output: structural cycle: 684 // ./in.cue:205:14 685 retry: (_|_){ 686 // [eval] issue1881.p1.o.retry: field not allowed: 687 // ./in.cue:197:17 688 } 689 } 690 #AllOutputs: (_|_){ 691 // [structural cycle] 692 reject: (string){ string } 693 resource: (string){ string } 694 retry: (_|_){ 695 // [structural cycle] 696 output: (_|_){ 697 // [structural cycle] issue1881.p1.0.reject: structural cycle: 698 // ./in.cue:205:14 699 } 700 } 701 } 702 #Output: (_|_){ 703 // [structural cycle] issue1881.p1.0.reject: structural cycle: 704 // ./in.cue:205:14 705 } 706 } 707 p2: (_|_){ 708 // [eval] 709 #AllOutputs: (_|_){ 710 // [structural cycle] 711 reject: (string){ string } 712 resource: (string){ string } 713 retry: (_|_){ 714 // [structural cycle] 715 output: (_|_){ 716 // [structural cycle] issue1881.p2.2.retry: structural cycle: 717 // ./in.cue:219:14 718 } 719 } 720 } 721 o: (_|_){ 722 // [eval] issue1881.p2.o.retry: field not allowed: 723 // ./in.cue:219:11 724 // ./in.cue:217:17 725 // issue1881.p2.2.retry: structural cycle: 726 // ./in.cue:219:14 727 retry: (_|_){ 728 // [eval] issue1881.p2.o.retry: field not allowed: 729 // ./in.cue:219:11 730 // ./in.cue:217:17 731 } 732 } 733 #Output: (_|_){ 734 // [structural cycle] issue1881.p2.2.retry: structural cycle: 735 // ./in.cue:219:14 736 } 737 } 738 p3: (_|_){ 739 // [eval] 740 #AllOutputs: (_|_){ 741 // [structural cycle] 742 reject: (string){ string } 743 resource: (string){ string } 744 retry: (_|_){ 745 // [structural cycle] 746 output: (_|_){ 747 // [structural cycle] issue1881.p3.2.retry: structural cycle: 748 // ./in.cue:231:14 749 } 750 } 751 } 752 #Output: (_|_){ 753 // [structural cycle] issue1881.p3.2.retry: structural cycle: 754 // ./in.cue:231:14 755 } 756 o: (_|_){ 757 // [eval] issue1881.p3.o.retry: field not allowed: 758 // ./in.cue:231:11 759 // ./in.cue:235:17 760 // issue1881.p3.2.retry: structural cycle: 761 // ./in.cue:231:14 762 retry: (_|_){ 763 // [eval] issue1881.p3.o.retry: field not allowed: 764 // ./in.cue:231:11 765 // ./in.cue:235:17 766 } 767 } 768 } 769 } 770 siblingInsertion: (_|_){ 771 // [eval] 772 t1: (struct){ 773 p1: (struct){ 774 D: (struct){ 775 logging: (_){ _ } 776 } 777 deployment: (struct){ 778 logging: (struct){ 779 env2: (struct){ 780 ENV: (string){ "True" } 781 } 782 env: (struct){ 783 ENV: (string){ "True" } 784 } 785 } 786 } 787 } 788 p2: (struct){ 789 D: (struct){ 790 logging: (_){ _ } 791 } 792 deployment: (struct){ 793 logging: (struct){ 794 env2: (struct){ 795 ENV: (string){ "True" } 796 } 797 env: (struct){ 798 ENV: (string){ "True" } 799 } 800 } 801 } 802 } 803 } 804 t2: (_|_){ 805 // [eval] 806 p1: (_|_){ 807 // [eval] siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 808 // ./in.cue:277:21 809 D: (struct){ 810 logging: (_){ _ } 811 } 812 deployment: (_|_){ 813 // [eval] siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 814 // ./in.cue:277:21 815 } 816 } 817 p2: (_|_){ 818 // [eval] siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 819 // ./in.cue:292:21 820 D: (struct){ 821 logging: (_){ _ } 822 } 823 deployment: (_|_){ 824 // [eval] siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 825 // ./in.cue:292:21 826 } 827 } 828 } 829 } 830 issue2367: (_|_){ 831 // [structural cycle] issue2367.0: structural cycle: 832 // ./in.cue:308:11 833 } 834 } 835 -- diff/-out/evalalpha<==>+out/eval -- 836 diff old new 837 --- old 838 +++ new 839 @@ -1,5 +1,52 @@ 840 Errors: 841 -selfReferential.insertionError.A: field foo3 not allowed by earlier comprehension or reference cycle 842 +issue1881.p1.o.retry: field not allowed: 843 + ./in.cue:197:17 844 +selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 845 + ./in.cue:125:17 846 +selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced: 847 + ./in.cue:117:14 848 +selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 849 + ./in.cue:133:14 850 +selfReferential.acrossOr.t1.p1.2.retry: structural cycle: 851 + ./in.cue:133:14 852 +selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 853 + ./in.cue:139:11 854 + ./in.cue:143:17 855 +selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 856 + ./in.cue:139:14 857 +selfReferential.acrossOr.t1.p2.2.retry: structural cycle: 858 + ./in.cue:139:14 859 +selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 860 + ./in.cue:153:11 861 + ./in.cue:163:17 862 +selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 863 + ./in.cue:153:14 864 +selfReferential.acrossOr.t2.p1.2.b: structural cycle: 865 + ./in.cue:167:8 866 +selfReferential.acrossOr.t2.p2.2.b: structural cycle: 867 + ./in.cue:178:8 868 +selfReferential.acrossOr.t2.p3.2.b: structural cycle: 869 + ./in.cue:193:8 870 +issue1881.p1.0.reject: structural cycle: 871 + ./in.cue:205:14 872 +issue1881.p1.2.retry.output: structural cycle: 873 + ./in.cue:205:14 874 +issue1881.p2.o.retry: field not allowed: 875 + ./in.cue:219:11 876 + ./in.cue:217:17 877 +issue1881.p2.2.retry: structural cycle: 878 + ./in.cue:219:14 879 +issue1881.p3.o.retry: field not allowed: 880 + ./in.cue:231:11 881 + ./in.cue:235:17 882 +issue1881.p3.2.retry: structural cycle: 883 + ./in.cue:231:14 884 +siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 885 + ./in.cue:277:21 886 +siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 887 + ./in.cue:292:21 888 +issue2367.0: structural cycle: 889 + ./in.cue:308:11 890 891 Result: 892 (_|_){ 893 @@ -19,7 +66,9 @@ 894 B: (struct){ 895 a: (struct){ 896 parent: (string){ "" } 897 - children: (#list){ 898 + children: (_|_){ 899 + // [incomplete] B.a.children: cannot range over v.children (incomplete type _): 900 + // ./in.cue:19:40 901 } 902 } 903 } 904 @@ -52,17 +101,17 @@ 905 } 906 } 907 _e: (#struct){ 908 - f1: (#struct){ 909 - } 910 - f2: (#struct){ 911 - a: (#struct){ 912 - t: (#struct){ 913 - f1: (#struct){ 914 - } 915 - f2: (#struct){ 916 - } 917 - } 918 - } 919 + f2: (#struct){ 920 + a: (#struct){ 921 + t: (#struct){ 922 + f1: (#struct){ 923 + } 924 + f2: (#struct){ 925 + } 926 + } 927 + } 928 + } 929 + f1: (#struct){ 930 } 931 } 932 e: (#struct){ 933 @@ -112,15 +161,14 @@ 934 } 935 } 936 list: (struct){ 937 - panels: (#list){ 938 + panels: (_|_){ 939 + // [incomplete] selfReferential.list.panels: cannot range over panels (incomplete type _): 940 + // ./in.cue:103:15 941 0: (struct){ 942 - id: (int){ 0 } 943 } 944 1: (struct){ 945 - id: (int){ 1 } 946 } 947 2: (struct){ 948 - id: (int){ 2 } 949 } 950 } 951 } 952 @@ -127,116 +175,168 @@ 953 insertionError: (_|_){ 954 // [eval] 955 A: (_|_){ 956 - // [eval] selfReferential.insertionError.A: field foo3 not allowed by earlier comprehension or reference cycle 957 + // [eval] selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced: 958 + // ./in.cue:117:14 959 foo: (int){ 1 } 960 - foo3: (int){ 1 } 961 - } 962 - } 963 - acrossOr: (struct){ 964 - t1: (struct){ 965 - p1: (struct){ 966 - o: (#struct){ 967 - retry: (#struct){ 968 - reject: (string){ "ok" } 969 - } 970 - } 971 - #AllOutputs: (#struct){ 972 - reject: (string){ string } 973 - resource: (string){ string } 974 - retry: (#struct){ |((#struct){ 975 - reject: (string){ string } 976 - }, (#struct){ 977 - resource: (string){ string } 978 - }) } 979 - } 980 - #Output: (#struct){ |((#struct){ 981 - reject: (string){ string } 982 - }, (#struct){ 983 - resource: (string){ string } 984 - }) } 985 - } 986 - p2: (struct){ 987 - #Output: (#struct){ |((#struct){ 988 - reject: (string){ string } 989 - }, (#struct){ 990 - resource: (string){ string } 991 - }) } 992 - o: (#struct){ 993 - retry: (#struct){ 994 - reject: (string){ "ok" } 995 - } 996 - } 997 - #AllOutputs: (#struct){ 998 - reject: (string){ string } 999 - resource: (string){ string } 1000 - retry: (#struct){ |((#struct){ 1001 - reject: (string){ string } 1002 - }, (#struct){ 1003 - resource: (string){ string } 1004 - }) } 1005 - } 1006 - } 1007 - p3: (struct){ 1008 - #Output: (#struct){ |((#struct){ 1009 - reject: (string){ string } 1010 - }, (#struct){ 1011 - resource: (string){ string } 1012 - }) } 1013 - #AllOutputs: (#struct){ 1014 - reject: (string){ string } 1015 - resource: (string){ string } 1016 - retry: (#struct){ |((#struct){ 1017 - reject: (string){ string } 1018 - }, (#struct){ 1019 - resource: (string){ string } 1020 - }) } 1021 - } 1022 - o: (#struct){ 1023 - retry: (#struct){ 1024 - reject: (string){ "ok" } 1025 - } 1026 - } 1027 - } 1028 - } 1029 - t2: (struct){ 1030 - p1: (struct){ 1031 - d: ((int|string)){ |((int){ int }, (string){ string }) } 1032 - o: (struct){ 1033 - b: (int){ 2 } 1034 - } 1035 - #A: (#struct){ 1036 - d1: (int){ int } 1037 - d2: (string){ string } 1038 - d3: (#struct){ 1039 - b: ((int|string)){ |((int){ int }, (string){ string }) } 1040 - } 1041 - } 1042 - } 1043 - p2: (struct){ 1044 - o: (struct){ 1045 - b: (int){ 2 } 1046 - } 1047 - d: ((int|string)){ |((int){ int }, (string){ string }) } 1048 - #A: (#struct){ 1049 - d1: (int){ int } 1050 - d2: (string){ string } 1051 - d3: (#struct){ 1052 - b: ((int|string)){ |((int){ int }, (string){ string }) } 1053 - } 1054 - } 1055 - } 1056 - p3: (struct){ 1057 - o: (struct){ 1058 - b: (int){ 2 } 1059 - } 1060 - #A: (#struct){ 1061 - d1: (int){ int } 1062 - d2: (string){ string } 1063 - d3: (#struct){ 1064 - b: ((int|string)){ |((int){ int }, (string){ string }) } 1065 - } 1066 - } 1067 - d: ((int|string)){ |((int){ int }, (string){ string }) } 1068 + } 1069 + } 1070 + acrossOr: (_|_){ 1071 + // [eval] 1072 + t1: (_|_){ 1073 + // [eval] 1074 + p1: (_|_){ 1075 + // [eval] 1076 + o: (_|_){ 1077 + // [eval] selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 1078 + // ./in.cue:125:17 1079 + // selfReferential.acrossOr.t1.p1.2.retry: structural cycle: 1080 + // ./in.cue:133:14 1081 + retry: (_|_){ 1082 + // [eval] selfReferential.acrossOr.t1.p1.o.retry: field not allowed: 1083 + // ./in.cue:125:17 1084 + } 1085 + } 1086 + #AllOutputs: (_|_){ 1087 + // [structural cycle] 1088 + reject: (string){ string } 1089 + resource: (string){ string } 1090 + retry: (_|_){ 1091 + // [structural cycle] selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 1092 + // ./in.cue:133:14 1093 + } 1094 + } 1095 + #Output: (_|_){ 1096 + // [structural cycle] selfReferential.acrossOr.t1.p1.0.reject: structural cycle: 1097 + // ./in.cue:133:14 1098 + } 1099 + } 1100 + p2: (_|_){ 1101 + // [eval] 1102 + #Output: (_|_){ 1103 + // [structural cycle] selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 1104 + // ./in.cue:139:14 1105 + } 1106 + o: (_|_){ 1107 + // [eval] selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 1108 + // ./in.cue:139:11 1109 + // ./in.cue:143:17 1110 + // selfReferential.acrossOr.t1.p2.2.retry: structural cycle: 1111 + // ./in.cue:139:14 1112 + retry: (_|_){ 1113 + // [eval] selfReferential.acrossOr.t1.p2.o.retry: field not allowed: 1114 + // ./in.cue:139:11 1115 + // ./in.cue:143:17 1116 + } 1117 + } 1118 + #AllOutputs: (_|_){ 1119 + // [structural cycle] 1120 + reject: (string){ string } 1121 + resource: (string){ string } 1122 + retry: (_|_){ 1123 + // [structural cycle] selfReferential.acrossOr.t1.p2.0.reject: structural cycle: 1124 + // ./in.cue:139:14 1125 + } 1126 + } 1127 + } 1128 + p3: (_|_){ 1129 + // [eval] 1130 + #Output: (_|_){ 1131 + // [structural cycle] selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 1132 + // ./in.cue:153:14 1133 + } 1134 + #AllOutputs: (_|_){ 1135 + // [structural cycle] 1136 + reject: (string){ string } 1137 + resource: (string){ string } 1138 + retry: (_|_){ 1139 + // [structural cycle] selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 1140 + // ./in.cue:153:14 1141 + } 1142 + } 1143 + o: (_|_){ 1144 + // [eval] selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 1145 + // ./in.cue:153:11 1146 + // ./in.cue:163:17 1147 + // selfReferential.acrossOr.t1.p3.0.reject: structural cycle: 1148 + // ./in.cue:153:14 1149 + retry: (_|_){ 1150 + // [eval] selfReferential.acrossOr.t1.p3.o.retry: field not allowed: 1151 + // ./in.cue:153:11 1152 + // ./in.cue:163:17 1153 + } 1154 + } 1155 + } 1156 + } 1157 + t2: (_|_){ 1158 + // [structural cycle] 1159 + p1: (_|_){ 1160 + // [structural cycle] 1161 + d: (_|_){ 1162 + // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 1163 + // ./in.cue:167:8 1164 + } 1165 + o: (_|_){ 1166 + // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 1167 + // ./in.cue:167:8 1168 + } 1169 + #A: (_|_){ 1170 + // [structural cycle] 1171 + d1: (int){ int } 1172 + d2: (string){ string } 1173 + d3: (_|_){ 1174 + // [structural cycle] 1175 + b: (_|_){ 1176 + // [structural cycle] selfReferential.acrossOr.t2.p1.2.b: structural cycle: 1177 + // ./in.cue:167:8 1178 + } 1179 + } 1180 + } 1181 + } 1182 + p2: (_|_){ 1183 + // [structural cycle] 1184 + o: (_|_){ 1185 + // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 1186 + // ./in.cue:178:8 1187 + } 1188 + d: (_|_){ 1189 + // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 1190 + // ./in.cue:178:8 1191 + } 1192 + #A: (_|_){ 1193 + // [structural cycle] 1194 + d1: (int){ int } 1195 + d2: (string){ string } 1196 + d3: (_|_){ 1197 + // [structural cycle] 1198 + b: (_|_){ 1199 + // [structural cycle] selfReferential.acrossOr.t2.p2.2.b: structural cycle: 1200 + // ./in.cue:178:8 1201 + } 1202 + } 1203 + } 1204 + } 1205 + p3: (_|_){ 1206 + // [structural cycle] 1207 + o: (_|_){ 1208 + // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 1209 + // ./in.cue:193:8 1210 + } 1211 + #A: (_|_){ 1212 + // [structural cycle] 1213 + d1: (int){ int } 1214 + d2: (string){ string } 1215 + d3: (_|_){ 1216 + // [structural cycle] 1217 + b: (_|_){ 1218 + // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 1219 + // ./in.cue:193:8 1220 + } 1221 + } 1222 + } 1223 + d: (_|_){ 1224 + // [structural cycle] selfReferential.acrossOr.t2.p3.2.b: structural cycle: 1225 + // ./in.cue:193:8 1226 + } 1227 } 1228 } 1229 } 1230 @@ -251,84 +351,102 @@ 1231 } 1232 } 1233 } 1234 - issue1881: (struct){ 1235 - p1: (struct){ 1236 - o: (#struct){ 1237 - retry: (#struct){ 1238 - output: (#struct){ 1239 - reject: (string){ "ok" } 1240 - } 1241 - } 1242 - } 1243 - #AllOutputs: (#struct){ 1244 - reject: (string){ string } 1245 - resource: (string){ string } 1246 - retry: (#struct){ 1247 - output: (#struct){ |((#struct){ 1248 - reject: (string){ string } 1249 - }, (#struct){ 1250 - resource: (string){ string } 1251 - }) } 1252 - } 1253 - } 1254 - #Output: (#struct){ |((#struct){ 1255 - reject: (string){ string } 1256 - }, (#struct){ 1257 - resource: (string){ string } 1258 - }) } 1259 - } 1260 - p2: (struct){ 1261 - #AllOutputs: (#struct){ 1262 - reject: (string){ string } 1263 - resource: (string){ string } 1264 - retry: (#struct){ 1265 - output: (#struct){ |((#struct){ 1266 - reject: (string){ string } 1267 - }, (#struct){ 1268 - resource: (string){ string } 1269 - }) } 1270 - } 1271 - } 1272 - o: (#struct){ 1273 - retry: (#struct){ 1274 - output: (#struct){ 1275 - reject: (string){ "ok" } 1276 - } 1277 - } 1278 - } 1279 - #Output: (#struct){ |((#struct){ 1280 - reject: (string){ string } 1281 - }, (#struct){ 1282 - resource: (string){ string } 1283 - }) } 1284 - } 1285 - p3: (struct){ 1286 - #AllOutputs: (#struct){ 1287 - reject: (string){ string } 1288 - resource: (string){ string } 1289 - retry: (#struct){ 1290 - output: (#struct){ |((#struct){ 1291 - reject: (string){ string } 1292 - }, (#struct){ 1293 - resource: (string){ string } 1294 - }) } 1295 - } 1296 - } 1297 - #Output: (#struct){ |((#struct){ 1298 - reject: (string){ string } 1299 - }, (#struct){ 1300 - resource: (string){ string } 1301 - }) } 1302 - o: (#struct){ 1303 - retry: (#struct){ 1304 - output: (#struct){ 1305 - reject: (string){ "ok" } 1306 - } 1307 - } 1308 - } 1309 - } 1310 - } 1311 - siblingInsertion: (struct){ 1312 + issue1881: (_|_){ 1313 + // [eval] 1314 + p1: (_|_){ 1315 + // [eval] 1316 + o: (_|_){ 1317 + // [eval] issue1881.p1.o.retry: field not allowed: 1318 + // ./in.cue:197:17 1319 + // issue1881.p1.2.retry.output: structural cycle: 1320 + // ./in.cue:205:14 1321 + retry: (_|_){ 1322 + // [eval] issue1881.p1.o.retry: field not allowed: 1323 + // ./in.cue:197:17 1324 + } 1325 + } 1326 + #AllOutputs: (_|_){ 1327 + // [structural cycle] 1328 + reject: (string){ string } 1329 + resource: (string){ string } 1330 + retry: (_|_){ 1331 + // [structural cycle] 1332 + output: (_|_){ 1333 + // [structural cycle] issue1881.p1.0.reject: structural cycle: 1334 + // ./in.cue:205:14 1335 + } 1336 + } 1337 + } 1338 + #Output: (_|_){ 1339 + // [structural cycle] issue1881.p1.0.reject: structural cycle: 1340 + // ./in.cue:205:14 1341 + } 1342 + } 1343 + p2: (_|_){ 1344 + // [eval] 1345 + #AllOutputs: (_|_){ 1346 + // [structural cycle] 1347 + reject: (string){ string } 1348 + resource: (string){ string } 1349 + retry: (_|_){ 1350 + // [structural cycle] 1351 + output: (_|_){ 1352 + // [structural cycle] issue1881.p2.2.retry: structural cycle: 1353 + // ./in.cue:219:14 1354 + } 1355 + } 1356 + } 1357 + o: (_|_){ 1358 + // [eval] issue1881.p2.o.retry: field not allowed: 1359 + // ./in.cue:219:11 1360 + // ./in.cue:217:17 1361 + // issue1881.p2.2.retry: structural cycle: 1362 + // ./in.cue:219:14 1363 + retry: (_|_){ 1364 + // [eval] issue1881.p2.o.retry: field not allowed: 1365 + // ./in.cue:219:11 1366 + // ./in.cue:217:17 1367 + } 1368 + } 1369 + #Output: (_|_){ 1370 + // [structural cycle] issue1881.p2.2.retry: structural cycle: 1371 + // ./in.cue:219:14 1372 + } 1373 + } 1374 + p3: (_|_){ 1375 + // [eval] 1376 + #AllOutputs: (_|_){ 1377 + // [structural cycle] 1378 + reject: (string){ string } 1379 + resource: (string){ string } 1380 + retry: (_|_){ 1381 + // [structural cycle] 1382 + output: (_|_){ 1383 + // [structural cycle] issue1881.p3.2.retry: structural cycle: 1384 + // ./in.cue:231:14 1385 + } 1386 + } 1387 + } 1388 + #Output: (_|_){ 1389 + // [structural cycle] issue1881.p3.2.retry: structural cycle: 1390 + // ./in.cue:231:14 1391 + } 1392 + o: (_|_){ 1393 + // [eval] issue1881.p3.o.retry: field not allowed: 1394 + // ./in.cue:231:11 1395 + // ./in.cue:235:17 1396 + // issue1881.p3.2.retry: structural cycle: 1397 + // ./in.cue:231:14 1398 + retry: (_|_){ 1399 + // [eval] issue1881.p3.o.retry: field not allowed: 1400 + // ./in.cue:231:11 1401 + // ./in.cue:235:17 1402 + } 1403 + } 1404 + } 1405 + } 1406 + siblingInsertion: (_|_){ 1407 + // [eval] 1408 t1: (struct){ 1409 p1: (struct){ 1410 D: (struct){ 1411 @@ -361,40 +479,34 @@ 1412 } 1413 } 1414 } 1415 - t2: (struct){ 1416 - p1: (struct){ 1417 - D: (struct){ 1418 - logging: (_){ _ } 1419 - } 1420 - deployment: (struct){ 1421 - logging: (struct){ 1422 - env2: (struct){ 1423 - ENV: (string){ "True" } 1424 - } 1425 - env: (struct){ 1426 - ENV: (string){ "True" } 1427 - } 1428 - } 1429 - } 1430 - } 1431 - p2: (struct){ 1432 - D: (struct){ 1433 - logging: (_){ _ } 1434 - } 1435 - deployment: (struct){ 1436 - logging: (struct){ 1437 - env2: (struct){ 1438 - ENV: (string){ "True" } 1439 - } 1440 - env: (struct){ 1441 - ENV: (string){ "True" } 1442 - } 1443 - } 1444 - } 1445 - } 1446 - } 1447 - } 1448 - issue2367: (struct){ 1449 - a: (_){ _ } 1450 + t2: (_|_){ 1451 + // [eval] 1452 + p1: (_|_){ 1453 + // [eval] siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 1454 + // ./in.cue:277:21 1455 + D: (struct){ 1456 + logging: (_){ _ } 1457 + } 1458 + deployment: (_|_){ 1459 + // [eval] siblingInsertion.t2.p1.deployment: adding field logging not allowed as field set was already referenced: 1460 + // ./in.cue:277:21 1461 + } 1462 + } 1463 + p2: (_|_){ 1464 + // [eval] siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 1465 + // ./in.cue:292:21 1466 + D: (struct){ 1467 + logging: (_){ _ } 1468 + } 1469 + deployment: (_|_){ 1470 + // [eval] siblingInsertion.t2.p2.deployment: adding field logging not allowed as field set was already referenced: 1471 + // ./in.cue:292:21 1472 + } 1473 + } 1474 + } 1475 + } 1476 + issue2367: (_|_){ 1477 + // [structural cycle] issue2367.0: structural cycle: 1478 + // ./in.cue:308:11 1479 } 1480 } 1481 -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 1482 diff old new 1483 --- old 1484 +++ new 1485 @@ -1,9 +1,9 @@ 1486 -Leaks: 50 1487 -Freed: 1270 1488 -Reused: 1260 1489 -Allocs: 60 1490 -Retain: 145 1491 +Leaks: 431 1492 +Freed: 12 1493 +Reused: 12 1494 +Allocs: 431 1495 +Retain: 0 1496 1497 -Unifications: 832 1498 -Conjuncts: 2525 1499 -Disjuncts: 1404 1500 +Unifications: 397 1501 +Conjuncts: 2202 1502 +Disjuncts: 36 1503 -- out/eval/stats -- 1504 Leaks: 50 1505 Freed: 1270 1506 Reused: 1260 1507 Allocs: 60 1508 Retain: 145 1509 1510 Unifications: 832 1511 Conjuncts: 2525 1512 Disjuncts: 1404 1513 -- diff/todo/p0 -- 1514 selfReferential.list.panels: invalid incomplete error: related to "or" builtin 1515 selfReferential.acrossOr: many errors: related to "or" builtin 1516 issue1881: differences: related to "or" builtin 1517 ... 1518 -- out/eval -- 1519 Errors: 1520 selfReferential.insertionError.A: field foo3 not allowed by earlier comprehension or reference cycle 1521 1522 Result: 1523 (_|_){ 1524 // [eval] 1525 A: (struct){ 1526 a: (struct){ 1527 parent: (string){ "" } 1528 children: (#list){ 1529 } 1530 } 1531 b: (struct){ 1532 parent: (string){ "a" } 1533 children: (#list){ 1534 } 1535 } 1536 } 1537 B: (struct){ 1538 a: (struct){ 1539 parent: (string){ "" } 1540 children: (#list){ 1541 } 1542 } 1543 } 1544 Issue486: (struct){ 1545 A: (struct){ 1546 a: (struct){ 1547 parent: (string){ "" } 1548 children: (#list){ 1549 0: (string){ "b" } 1550 } 1551 } 1552 b: (struct){ 1553 parent: (string){ "a" } 1554 children: (#list){ 1555 0: (string){ "c" } 1556 } 1557 } 1558 c: (struct){ 1559 parent: (string){ "b" } 1560 children: (#list){ 1561 } 1562 } 1563 } 1564 } 1565 issue1666: (struct){ 1566 #E: (#struct){ 1567 f1: (#struct){ 1568 } 1569 f2: (#struct){ 1570 } 1571 } 1572 _e: (#struct){ 1573 f1: (#struct){ 1574 } 1575 f2: (#struct){ 1576 a: (#struct){ 1577 t: (#struct){ 1578 f1: (#struct){ 1579 } 1580 f2: (#struct){ 1581 } 1582 } 1583 } 1584 } 1585 } 1586 e: (#struct){ 1587 f1: (#struct){ 1588 a: (#struct){ 1589 f1: (#struct){ 1590 } 1591 f2: (#struct){ 1592 } 1593 } 1594 } 1595 f2: (#struct){ 1596 a: (#struct){ 1597 t: (#struct){ 1598 f1: (#struct){ 1599 } 1600 f2: (#struct){ 1601 } 1602 } 1603 } 1604 } 1605 } 1606 } 1607 issue779: (struct){ 1608 X: (string){ "test" } 1609 STATE: (struct){ 1610 code: (int){ 101 } 1611 } 1612 Y: (struct){ 1613 message: (string){ "test" } 1614 code: (int){ 101 } 1615 } 1616 } 1617 selfReferential: (_|_){ 1618 // [eval] 1619 T1: (struct){ 1620 S: (struct){ 1621 d: (string){ "bar" } 1622 } 1623 T: (struct){ 1624 e: (struct){ 1625 S: (struct){ 1626 a: (string){ "foo" } 1627 d: (string){ "bar" } 1628 } 1629 } 1630 } 1631 } 1632 list: (struct){ 1633 panels: (#list){ 1634 0: (struct){ 1635 id: (int){ 0 } 1636 } 1637 1: (struct){ 1638 id: (int){ 1 } 1639 } 1640 2: (struct){ 1641 id: (int){ 2 } 1642 } 1643 } 1644 } 1645 insertionError: (_|_){ 1646 // [eval] 1647 A: (_|_){ 1648 // [eval] selfReferential.insertionError.A: field foo3 not allowed by earlier comprehension or reference cycle 1649 foo: (int){ 1 } 1650 foo3: (int){ 1 } 1651 } 1652 } 1653 acrossOr: (struct){ 1654 t1: (struct){ 1655 p1: (struct){ 1656 o: (#struct){ 1657 retry: (#struct){ 1658 reject: (string){ "ok" } 1659 } 1660 } 1661 #AllOutputs: (#struct){ 1662 reject: (string){ string } 1663 resource: (string){ string } 1664 retry: (#struct){ |((#struct){ 1665 reject: (string){ string } 1666 }, (#struct){ 1667 resource: (string){ string } 1668 }) } 1669 } 1670 #Output: (#struct){ |((#struct){ 1671 reject: (string){ string } 1672 }, (#struct){ 1673 resource: (string){ string } 1674 }) } 1675 } 1676 p2: (struct){ 1677 #Output: (#struct){ |((#struct){ 1678 reject: (string){ string } 1679 }, (#struct){ 1680 resource: (string){ string } 1681 }) } 1682 o: (#struct){ 1683 retry: (#struct){ 1684 reject: (string){ "ok" } 1685 } 1686 } 1687 #AllOutputs: (#struct){ 1688 reject: (string){ string } 1689 resource: (string){ string } 1690 retry: (#struct){ |((#struct){ 1691 reject: (string){ string } 1692 }, (#struct){ 1693 resource: (string){ string } 1694 }) } 1695 } 1696 } 1697 p3: (struct){ 1698 #Output: (#struct){ |((#struct){ 1699 reject: (string){ string } 1700 }, (#struct){ 1701 resource: (string){ string } 1702 }) } 1703 #AllOutputs: (#struct){ 1704 reject: (string){ string } 1705 resource: (string){ string } 1706 retry: (#struct){ |((#struct){ 1707 reject: (string){ string } 1708 }, (#struct){ 1709 resource: (string){ string } 1710 }) } 1711 } 1712 o: (#struct){ 1713 retry: (#struct){ 1714 reject: (string){ "ok" } 1715 } 1716 } 1717 } 1718 } 1719 t2: (struct){ 1720 p1: (struct){ 1721 d: ((int|string)){ |((int){ int }, (string){ string }) } 1722 o: (struct){ 1723 b: (int){ 2 } 1724 } 1725 #A: (#struct){ 1726 d1: (int){ int } 1727 d2: (string){ string } 1728 d3: (#struct){ 1729 b: ((int|string)){ |((int){ int }, (string){ string }) } 1730 } 1731 } 1732 } 1733 p2: (struct){ 1734 o: (struct){ 1735 b: (int){ 2 } 1736 } 1737 d: ((int|string)){ |((int){ int }, (string){ string }) } 1738 #A: (#struct){ 1739 d1: (int){ int } 1740 d2: (string){ string } 1741 d3: (#struct){ 1742 b: ((int|string)){ |((int){ int }, (string){ string }) } 1743 } 1744 } 1745 } 1746 p3: (struct){ 1747 o: (struct){ 1748 b: (int){ 2 } 1749 } 1750 #A: (#struct){ 1751 d1: (int){ int } 1752 d2: (string){ string } 1753 d3: (#struct){ 1754 b: ((int|string)){ |((int){ int }, (string){ string }) } 1755 } 1756 } 1757 d: ((int|string)){ |((int){ int }, (string){ string }) } 1758 } 1759 } 1760 } 1761 fail: (_|_){ 1762 // [incomplete] selfReferential.fail.b: undefined field: x: 1763 // ./in.cue:300:7 1764 a: (struct){ 1765 } 1766 b: (_|_){ 1767 // [incomplete] selfReferential.fail.b: undefined field: x: 1768 // ./in.cue:300:7 1769 } 1770 } 1771 } 1772 issue1881: (struct){ 1773 p1: (struct){ 1774 o: (#struct){ 1775 retry: (#struct){ 1776 output: (#struct){ 1777 reject: (string){ "ok" } 1778 } 1779 } 1780 } 1781 #AllOutputs: (#struct){ 1782 reject: (string){ string } 1783 resource: (string){ string } 1784 retry: (#struct){ 1785 output: (#struct){ |((#struct){ 1786 reject: (string){ string } 1787 }, (#struct){ 1788 resource: (string){ string } 1789 }) } 1790 } 1791 } 1792 #Output: (#struct){ |((#struct){ 1793 reject: (string){ string } 1794 }, (#struct){ 1795 resource: (string){ string } 1796 }) } 1797 } 1798 p2: (struct){ 1799 #AllOutputs: (#struct){ 1800 reject: (string){ string } 1801 resource: (string){ string } 1802 retry: (#struct){ 1803 output: (#struct){ |((#struct){ 1804 reject: (string){ string } 1805 }, (#struct){ 1806 resource: (string){ string } 1807 }) } 1808 } 1809 } 1810 o: (#struct){ 1811 retry: (#struct){ 1812 output: (#struct){ 1813 reject: (string){ "ok" } 1814 } 1815 } 1816 } 1817 #Output: (#struct){ |((#struct){ 1818 reject: (string){ string } 1819 }, (#struct){ 1820 resource: (string){ string } 1821 }) } 1822 } 1823 p3: (struct){ 1824 #AllOutputs: (#struct){ 1825 reject: (string){ string } 1826 resource: (string){ string } 1827 retry: (#struct){ 1828 output: (#struct){ |((#struct){ 1829 reject: (string){ string } 1830 }, (#struct){ 1831 resource: (string){ string } 1832 }) } 1833 } 1834 } 1835 #Output: (#struct){ |((#struct){ 1836 reject: (string){ string } 1837 }, (#struct){ 1838 resource: (string){ string } 1839 }) } 1840 o: (#struct){ 1841 retry: (#struct){ 1842 output: (#struct){ 1843 reject: (string){ "ok" } 1844 } 1845 } 1846 } 1847 } 1848 } 1849 siblingInsertion: (struct){ 1850 t1: (struct){ 1851 p1: (struct){ 1852 D: (struct){ 1853 logging: (_){ _ } 1854 } 1855 deployment: (struct){ 1856 logging: (struct){ 1857 env2: (struct){ 1858 ENV: (string){ "True" } 1859 } 1860 env: (struct){ 1861 ENV: (string){ "True" } 1862 } 1863 } 1864 } 1865 } 1866 p2: (struct){ 1867 D: (struct){ 1868 logging: (_){ _ } 1869 } 1870 deployment: (struct){ 1871 logging: (struct){ 1872 env2: (struct){ 1873 ENV: (string){ "True" } 1874 } 1875 env: (struct){ 1876 ENV: (string){ "True" } 1877 } 1878 } 1879 } 1880 } 1881 } 1882 t2: (struct){ 1883 p1: (struct){ 1884 D: (struct){ 1885 logging: (_){ _ } 1886 } 1887 deployment: (struct){ 1888 logging: (struct){ 1889 env2: (struct){ 1890 ENV: (string){ "True" } 1891 } 1892 env: (struct){ 1893 ENV: (string){ "True" } 1894 } 1895 } 1896 } 1897 } 1898 p2: (struct){ 1899 D: (struct){ 1900 logging: (_){ _ } 1901 } 1902 deployment: (struct){ 1903 logging: (struct){ 1904 env2: (struct){ 1905 ENV: (string){ "True" } 1906 } 1907 env: (struct){ 1908 ENV: (string){ "True" } 1909 } 1910 } 1911 } 1912 } 1913 } 1914 } 1915 issue2367: (struct){ 1916 a: (_){ _ } 1917 } 1918 } 1919 -- out/compile -- 1920 --- in.cue 1921 { 1922 A: { 1923 a: { 1924 parent: "" 1925 children: [ 1926 for k, v in 〈3;A〉 if (〈0;v〉.parent == 〈0;k〉) { 1927 〈1;k〉 1928 }, 1929 ] 1930 } 1931 b: { 1932 parent: "a" 1933 children: [ 1934 for k, v in 〈3;A〉 if (〈0;v〉.parent == 〈0;k〉) { 1935 〈1;k〉 1936 }, 1937 ] 1938 } 1939 } 1940 B: { 1941 a: { 1942 parent: "" 1943 children: [ 1944 for k, v in 〈3;B〉 for _, w in 〈0;v〉.children { 1945 〈2;k〉 1946 }, 1947 ] 1948 } 1949 } 1950 Issue486: { 1951 A: { 1952 a: { 1953 parent: "" 1954 children: [ 1955 ...string, 1956 ] 1957 } 1958 b: { 1959 parent: "a" 1960 children: [ 1961 ...string, 1962 ] 1963 } 1964 c: { 1965 parent: "b" 1966 children: [ 1967 ...string, 1968 ] 1969 } 1970 } 1971 A: { 1972 [string]: { 1973 children: [ 1974 for k, v in 〈3;A〉 if (〈0;v〉.parent == 〈3;-〉) { 1975 〈1;k〉 1976 }, 1977 ] 1978 } 1979 } 1980 } 1981 issue1666: { 1982 #E: { 1983 f1: { 1984 [string]: (〈2;#E〉|[ 1985 ...〈3;#E〉, 1986 ]) 1987 } 1988 f2: { 1989 [string]: { 1990 t: 〈3;#E〉 1991 } 1992 } 1993 } 1994 _e: 〈0;#E〉 1995 _e: { 1996 f2: { 1997 a: _ 1998 } 1999 } 2000 e: (〈0;_e〉 & { 2001 f1: { 2002 for fk, s in 〈2;_e〉.f2 { 2003 〈1;fk〉: 〈1;s〉.t 2004 } 2005 } 2006 }) 2007 } 2008 issue779: { 2009 X: 〈0;Y〉.message 2010 STATE: { 2011 for k, v in 〈1;Y〉 { 2012 if (〈1;k〉 != "message") { 2013 "\(〈2;k〉)": 〈2;v〉 2014 } 2015 } 2016 } 2017 Y: (〈0;STATE〉 & { 2018 message: 〈1;X〉 2019 }) 2020 X: "test" 2021 STATE: { 2022 code: 101 2023 } 2024 } 2025 selfReferential: { 2026 T1: { 2027 S: { 2028 d: "bar" 2029 } 2030 T: { 2031 e: { 2032 S: { 2033 a: "foo" 2034 } 2035 } 2036 } 2037 for s, v in 〈0;S〉 for t, _ in 〈1;T〉 { 2038 T: { 2039 〈2;t〉: { 2040 S: { 2041 〈5;s〉: 〈5;v〉 2042 } 2043 } 2044 } 2045 } 2046 } 2047 } 2048 selfReferential: { 2049 list: { 2050 panels: [ 2051 for i, _ in 〈1;panels〉 { 2052 id: 〈1;i〉 2053 }, 2054 ] 2055 panels: [ 2056 {}, 2057 {}, 2058 {}, 2059 ] 2060 } 2061 } 2062 selfReferential: { 2063 insertionError: { 2064 A: { 2065 foo: 1 2066 for _, x in 〈1;A〉 { 2067 "foo3": 1 2068 } 2069 } 2070 } 2071 } 2072 selfReferential: { 2073 acrossOr: { 2074 t1: { 2075 p1: { 2076 o: (〈0;#Output〉 & { 2077 retry: { 2078 reject: "ok" 2079 } 2080 }) 2081 #AllOutputs: { 2082 reject: string 2083 resource: string 2084 retry: 〈1;#Output〉 2085 } 2086 #Output: or([ 2087 for name, config in 〈1;#AllOutputs〉 { 2088 〈1;name〉: 〈1;config〉 2089 }, 2090 ]) 2091 } 2092 } 2093 } 2094 } 2095 selfReferential: { 2096 acrossOr: { 2097 t1: { 2098 p2: { 2099 #Output: or([ 2100 for name, config in 〈1;#AllOutputs〉 { 2101 〈1;name〉: 〈1;config〉 2102 }, 2103 ]) 2104 o: (〈0;#Output〉 & { 2105 retry: { 2106 reject: "ok" 2107 } 2108 }) 2109 #AllOutputs: { 2110 reject: string 2111 resource: string 2112 retry: 〈1;#Output〉 2113 } 2114 } 2115 } 2116 } 2117 } 2118 selfReferential: { 2119 acrossOr: { 2120 t1: { 2121 p3: { 2122 #Output: or([ 2123 for name, config in 〈1;#AllOutputs〉 { 2124 〈1;name〉: 〈1;config〉 2125 }, 2126 ]) 2127 #AllOutputs: { 2128 reject: string 2129 resource: string 2130 retry: 〈1;#Output〉 2131 } 2132 o: (〈0;#Output〉 & { 2133 retry: { 2134 reject: "ok" 2135 } 2136 }) 2137 } 2138 } 2139 } 2140 } 2141 selfReferential: { 2142 acrossOr: { 2143 t2: { 2144 p1: { 2145 d: or([ 2146 for x, y in 〈1;#A〉 { 2147 〈1;y〉 2148 }, 2149 ]) 2150 o: (〈0;d〉 & { 2151 b: 2 2152 }) 2153 #A: { 2154 d1: int 2155 d2: string 2156 d3: { 2157 b: 〈2;d〉 2158 } 2159 } 2160 } 2161 } 2162 } 2163 } 2164 selfReferential: { 2165 acrossOr: { 2166 t2: { 2167 p2: { 2168 o: (〈0;d〉 & { 2169 b: 2 2170 }) 2171 d: or([ 2172 for x, y in 〈1;#A〉 { 2173 〈1;y〉 2174 }, 2175 ]) 2176 #A: { 2177 d1: int 2178 d2: string 2179 d3: { 2180 b: 〈2;d〉 2181 } 2182 } 2183 } 2184 } 2185 } 2186 } 2187 selfReferential: { 2188 acrossOr: { 2189 t2: { 2190 p3: { 2191 o: (〈0;d〉 & { 2192 b: 2 2193 }) 2194 #A: { 2195 d1: int 2196 d2: string 2197 d3: { 2198 b: 〈2;d〉 2199 } 2200 } 2201 d: or([ 2202 for x, y in 〈1;#A〉 { 2203 〈1;y〉 2204 }, 2205 ]) 2206 } 2207 } 2208 } 2209 } 2210 issue1881: { 2211 p1: { 2212 o: (〈0;#Output〉 & { 2213 retry: { 2214 output: { 2215 reject: "ok" 2216 } 2217 } 2218 }) 2219 #AllOutputs: { 2220 reject: string 2221 resource: string 2222 retry: { 2223 output: 〈2;#Output〉 2224 } 2225 } 2226 #Output: or([ 2227 for name, config in 〈1;#AllOutputs〉 { 2228 〈1;name〉: 〈1;config〉 2229 }, 2230 ]) 2231 } 2232 } 2233 issue1881: { 2234 p2: { 2235 #AllOutputs: { 2236 reject: string 2237 resource: string 2238 retry: { 2239 output: 〈2;#Output〉 2240 } 2241 } 2242 o: (〈0;#Output〉 & { 2243 retry: { 2244 output: { 2245 reject: "ok" 2246 } 2247 } 2248 }) 2249 #Output: or([ 2250 for name, config in 〈1;#AllOutputs〉 { 2251 〈1;name〉: 〈1;config〉 2252 }, 2253 ]) 2254 } 2255 } 2256 issue1881: { 2257 p3: { 2258 #AllOutputs: { 2259 reject: string 2260 resource: string 2261 retry: { 2262 output: 〈2;#Output〉 2263 } 2264 } 2265 #Output: or([ 2266 for name, config in 〈1;#AllOutputs〉 { 2267 〈1;name〉: 〈1;config〉 2268 }, 2269 ]) 2270 o: (〈0;#Output〉 & { 2271 retry: { 2272 output: { 2273 reject: "ok" 2274 } 2275 } 2276 }) 2277 } 2278 } 2279 siblingInsertion: { 2280 t1: { 2281 p1: { 2282 D: { 2283 logging: _ 2284 } 2285 deployment: _ 2286 for k, v in 〈0;deployment〉 for k1, v2 in 〈0;v〉.env2 { 2287 deployment: { 2288 〈3;k〉: { 2289 env: { 2290 〈4;k1〉: 〈4;v2〉 2291 } 2292 } 2293 } 2294 } 2295 for id, v in 〈0;D〉 { 2296 deployment: { 2297 〈2;id〉: { 2298 env2: { 2299 ENV: "True" 2300 } 2301 } 2302 } 2303 } 2304 } 2305 } 2306 } 2307 siblingInsertion: { 2308 t1: { 2309 p2: { 2310 D: { 2311 logging: _ 2312 } 2313 deployment: _ 2314 for id, v in 〈0;D〉 { 2315 deployment: { 2316 〈2;id〉: { 2317 env2: { 2318 ENV: "True" 2319 } 2320 } 2321 } 2322 } 2323 for k, v in 〈0;deployment〉 for k1, v2 in 〈0;v〉.env2 { 2324 deployment: { 2325 〈3;k〉: { 2326 env: { 2327 〈4;k1〉: 〈4;v2〉 2328 } 2329 } 2330 } 2331 } 2332 } 2333 } 2334 } 2335 siblingInsertion: { 2336 t2: { 2337 p1: { 2338 D: { 2339 logging: _ 2340 } 2341 deployment: _ 2342 for k, v in 〈0;deployment〉 { 2343 for k1, v2 in 〈1;v〉.env2 { 2344 deployment: { 2345 〈4;k〉: { 2346 env: { 2347 〈4;k1〉: 〈4;v2〉 2348 } 2349 } 2350 } 2351 } 2352 } 2353 for id, v in 〈0;D〉 { 2354 deployment: { 2355 〈2;id〉: { 2356 env2: { 2357 ENV: "True" 2358 } 2359 } 2360 } 2361 } 2362 } 2363 } 2364 } 2365 siblingInsertion: { 2366 t2: { 2367 p2: { 2368 D: { 2369 logging: _ 2370 } 2371 deployment: _ 2372 for k, v in 〈0;deployment〉 { 2373 for k1, v2 in 〈1;v〉.env2 { 2374 deployment: { 2375 〈4;k〉: { 2376 env: { 2377 〈4;k1〉: 〈4;v2〉 2378 } 2379 } 2380 } 2381 } 2382 } 2383 for id, v in 〈0;D〉 { 2384 deployment: { 2385 〈2;id〉: { 2386 env2: { 2387 ENV: "True" 2388 } 2389 } 2390 } 2391 } 2392 } 2393 } 2394 } 2395 selfReferential: { 2396 fail: { 2397 a: {} 2398 b: (〈0;a〉.x != "") 2399 if 〈0;b〉 {} 2400 } 2401 } 2402 issue2367: { 2403 a: _ 2404 for _, x in [ 2405 〈1;a〉, 2406 ] { 2407 a: 〈1;x〉 2408 } 2409 } 2410 }