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