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