this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add tests for closing of arguments to validators

evalv3 would close literal structs as arguments to
functions and validators if they were defined within
a definition. This was not in line with V2.

We want to bring this in line with V2 with the new
closedness implementation for evalv3.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I36937474968d684694003846147465616c409786
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211384
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+1323 -19
+1323 -19
cue/testdata/builtins/matchn.txtar
··· 230 230 x: bar: 2 231 231 x: matchN(1, [{bar: 3}, {bar: 2, foo!: int}]) 232 232 } 233 + -- closedness.cue -- 234 + ellipsis: ok: { 235 + out: #Schema & { 236 + field: shouldBeAllowed: 123 237 + } 238 + #Schema: { 239 + field?: #anything 240 + #anything: matchN(1, [{ ... }]) 241 + } 242 + } 243 + // Arguments to function are not closed by enclosing definition. 244 + openArguments: ok1: { 245 + #Schema: {{ 246 + a: matchN(1, ["all", {foo: "bar"}]) 247 + }} 248 + out: #Schema & { 249 + a: baz: "allowed" 250 + } 251 + } 252 + openArguments: err2: { 253 + #Schema: {{ 254 + a?: matchN(1, [ //fails 255 + null, // fail 256 + { [string]: string }, // pass 257 + {b: {...}}, // pass 258 + ]) 259 + }} 260 + out: #Schema & { 261 + a: allowed: "once" 262 + } 263 + } 264 + explicitClose: err1: { 265 + #Schema: {{ 266 + a: matchN(1, ["all", close({foo: "bar"})]) 267 + }} 268 + out: #Schema & { 269 + a: baz: "notAllowed" 270 + } 271 + } 272 + explicitClose: ok2: { 273 + #Schema: {{ 274 + a?: matchN(1, [ 275 + null, // fail 276 + close({ [string]: string }), // pass 277 + close({b: {...}}), // fail 278 + ]) 279 + }} 280 + out: #Schema & { 281 + a: allowed: "once" 282 + } 283 + } 284 + mixed: ok3: { 285 + #Schema: { 286 + exports?: matchN(1, [ 287 + close({ never?: _ }), // fail 288 + #exportsObject, // pass 289 + ]) 290 + 291 + #exports: matchN(1, [string, #exportsObject]) 292 + #exportsObject: exp1?: #exports 293 + } 294 + 295 + out: #Schema & { 296 + exports: exp1: "./main-module.js" 297 + } 298 + } 299 + 300 + closedByDefinition: ok4: { 301 + #Schema: { 302 + exports?: matchN(1, [string, #exportsObject]) 303 + #exports: matchN(1, [string, #exportsObject]) 304 + #exportsObject: exp1?: #exports 305 + } 306 + 307 + out: #Schema & { 308 + exports: exp1: "./main-module.js" 309 + } 310 + } 311 + closedByDefinition: err5: { 312 + #Schema: { 313 + exports?: matchN(1, [null, #exportsObject]) 314 + #exports: matchN(1, [null, #exportsObject]) 315 + #exportsObject: exp1?: #exports 316 + } 317 + 318 + out: #Schema & { 319 + exports: exp1: "./main-module.js" 320 + } 321 + } 233 322 -- issue3694.cue -- 234 323 issue3694: full: { 235 324 #step: matchN(1, [{ ··· 257 346 }) 258 347 } 259 348 -- out/eval/stats -- 260 - Leaks: 19 261 - Freed: 774 262 - Reused: 767 263 - Allocs: 26 264 - Retain: 76 349 + Leaks: 52 350 + Freed: 951 351 + Reused: 944 352 + Allocs: 59 353 + Retain: 129 265 354 266 - Unifications: 777 267 - Conjuncts: 1292 268 - Disjuncts: 851 355 + Unifications: 987 356 + Conjuncts: 1635 357 + Disjuncts: 1081 269 358 -- out/eval -- 270 359 Errors: 360 + closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 361 + ./closedness.cue:80:13 362 + ./closedness.cue:80:24 363 + ./closedness.cue:85:7 364 + ./closedness.cue:86:12 365 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 366 + ./closedness.cue:80:30 367 + ./closedness.cue:81:24 368 + ./closedness.cue:82:26 369 + ./closedness.cue:85:7 370 + ./closedness.cue:86:18 371 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 372 + ./closedness.cue:80:30 373 + ./closedness.cue:81:30 374 + ./closedness.cue:82:19 375 + ./closedness.cue:82:26 376 + ./closedness.cue:85:7 377 + ./closedness.cue:86:18 378 + explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 379 + ./closedness.cue:32:12 380 + ./closedness.cue:33:6 381 + ./closedness.cue:33:17 382 + ./closedness.cue:35:7 383 + ./closedness.cue:36:6 271 384 incomplete.err1.x.bar: conflicting values 2 and string (mismatched types int and string): 272 385 ./incomplete.cue:34:24 273 386 ./incomplete.cue:35:11 ··· 291 404 ./in.cue:8:17 292 405 ./in.cue:8:28 293 406 ./in.cue:10:16 407 + openArguments.err2.out.a: conflicting values null and {allowed:"once"} (mismatched types null and struct): 408 + ./closedness.cue:20:12 409 + ./closedness.cue:21:13 410 + ./closedness.cue:22:5 411 + ./closedness.cue:27:7 412 + ./closedness.cue:28:6 413 + openArguments.err2.out.a: invalid value {allowed:"once"} (does not satisfy matchN): 2 matched, expected 1: 414 + ./closedness.cue:21:13 415 + ./closedness.cue:21:20 416 + ./closedness.cue:28:6 417 + explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 418 + ./closedness.cue:33:6 419 + ./closedness.cue:33:13 420 + ./closedness.cue:36:6 421 + explicitClose.err1.out.a.baz: field not allowed: 422 + ./closedness.cue:33:6 423 + ./closedness.cue:32:12 424 + ./closedness.cue:33:24 425 + ./closedness.cue:33:30 426 + ./closedness.cue:35:7 427 + ./closedness.cue:36:11 428 + closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 429 + ./closedness.cue:80:13 430 + ./closedness.cue:80:20 431 + ./closedness.cue:86:12 432 + closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 433 + ./closedness.cue:81:13 434 + ./closedness.cue:81:20 435 + ./closedness.cue:82:26 436 + ./closedness.cue:86:18 294 437 match.singleErr: invalid value {a:"foo"} (does not satisfy matchN): 0 matched, expected 1: 295 438 ./in.cue:8:17 296 439 ./in.cue:8:24 ··· 417 560 Result: 418 561 (_|_){ 419 562 // [eval] 563 + ellipsis: (struct){ 564 + ok: (struct){ 565 + out: (#struct){ 566 + field: (struct){ 567 + shouldBeAllowed: (int){ 123 } 568 + } 569 + #anything: (_){ matchN(1, (#list){ 570 + 0: (_|_){// { 571 + // ... 572 + // } 573 + } 574 + }) } 575 + } 576 + #Schema: (#struct){ 577 + field?: (_){ matchN(1, (#list){ 578 + 0: (_|_){// { 579 + // ... 580 + // } 581 + } 582 + }) } 583 + #anything: (_){ matchN(1, (#list){ 584 + 0: (_|_){// { 585 + // ... 586 + // } 587 + } 588 + }) } 589 + } 590 + } 591 + } 592 + openArguments: (_|_){ 593 + // [eval] 594 + ok1: (struct){ 595 + #Schema: (#struct){ 596 + a: (_){ matchN(1, (#list){ 597 + 0: (_|_){// "all" 598 + } 599 + 1: (_|_){// { 600 + // foo: "bar" 601 + // } 602 + } 603 + }) } 604 + } 605 + out: (#struct){ 606 + a: (struct){ 607 + baz: (string){ "allowed" } 608 + } 609 + } 610 + } 611 + err2: (_|_){ 612 + // [eval] 613 + #Schema: (#struct){ 614 + a?: (_){ matchN(1, (#list){ 615 + 0: (_|_){// null 616 + } 617 + 1: (_|_){// { 618 + // [string]: string 619 + // } 620 + } 621 + 2: (_|_){// { 622 + // b: { 623 + // ... 624 + // } 625 + // } 626 + } 627 + }) } 628 + } 629 + out: (_|_){ 630 + // [eval] 631 + a: (_|_){ 632 + // [eval] openArguments.err2.out.a: conflicting values null and {allowed:"once"} (mismatched types null and struct): 633 + // ./closedness.cue:20:12 634 + // ./closedness.cue:21:13 635 + // ./closedness.cue:22:5 636 + // ./closedness.cue:27:7 637 + // ./closedness.cue:28:6 638 + // openArguments.err2.out.a: invalid value {allowed:"once"} (does not satisfy matchN): 2 matched, expected 1: 639 + // ./closedness.cue:21:13 640 + // ./closedness.cue:21:20 641 + // ./closedness.cue:28:6 642 + allowed: (string){ "once" } 643 + } 644 + } 645 + } 646 + } 647 + explicitClose: (_|_){ 648 + // [eval] 649 + err1: (_|_){ 650 + // [eval] 651 + #Schema: (#struct){ 652 + a: (_){ matchN(1, (#list){ 653 + 0: (_|_){// "all" 654 + } 655 + 1: (_|_){// close({ 656 + // foo: "bar" 657 + // }) 658 + } 659 + }) } 660 + } 661 + out: (_|_){ 662 + // [eval] 663 + a: (_|_){ 664 + // [eval] explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 665 + // ./closedness.cue:32:12 666 + // ./closedness.cue:33:6 667 + // ./closedness.cue:33:17 668 + // ./closedness.cue:35:7 669 + // ./closedness.cue:36:6 670 + // explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 671 + // ./closedness.cue:33:6 672 + // ./closedness.cue:33:13 673 + // ./closedness.cue:36:6 674 + // explicitClose.err1.out.a.baz: field not allowed: 675 + // ./closedness.cue:33:6 676 + // ./closedness.cue:32:12 677 + // ./closedness.cue:33:24 678 + // ./closedness.cue:33:30 679 + // ./closedness.cue:35:7 680 + // ./closedness.cue:36:11 681 + baz: (string){ "notAllowed" } 682 + } 683 + } 684 + } 685 + ok2: (struct){ 686 + #Schema: (#struct){ 687 + a?: (_){ matchN(1, (#list){ 688 + 0: (_|_){// null 689 + } 690 + 1: (_|_){// close({ 691 + // [string]: string 692 + // }) 693 + } 694 + 2: (_|_){// close({ 695 + // b: { 696 + // ... 697 + // } 698 + // }) 699 + } 700 + }) } 701 + } 702 + out: (#struct){ 703 + a: (struct){ 704 + allowed: (string){ "once" } 705 + } 706 + } 707 + } 708 + } 709 + mixed: (struct){ 710 + ok3: (struct){ 711 + #Schema: (#struct){ 712 + exports?: (_){ matchN(1, (#list){ 713 + 0: (_|_){// close({ 714 + // never?: _ 715 + // }) 716 + } 717 + 1: (_|_){// 〈1;#exportsObject〉 718 + } 719 + }) } 720 + #exports: (_){ matchN(1, (#list){ 721 + 0: (_|_){// string 722 + } 723 + 1: (_|_){// 〈1;#exportsObject〉 724 + } 725 + }) } 726 + #exportsObject: (#struct){ 727 + exp1?: (_){ matchN(1, (#list){ 728 + 0: (_|_){// string 729 + } 730 + 1: (_|_){// 〈1;#exportsObject〉 731 + } 732 + }) } 733 + } 734 + } 735 + out: (#struct){ 736 + exports: (struct){ 737 + exp1: (string){ "./main-module.js" } 738 + } 739 + #exports: (_){ matchN(1, (#list){ 740 + 0: (_|_){// string 741 + } 742 + 1: (_|_){// 〈1;#exportsObject〉 743 + } 744 + }) } 745 + #exportsObject: (#struct){ 746 + exp1?: (_){ matchN(1, (#list){ 747 + 0: (_|_){// string 748 + } 749 + 1: (_|_){// 〈1;#exportsObject〉 750 + } 751 + }) } 752 + } 753 + } 754 + } 755 + } 756 + closedByDefinition: (_|_){ 757 + // [eval] 758 + ok4: (struct){ 759 + #Schema: (#struct){ 760 + exports?: (_){ matchN(1, (#list){ 761 + 0: (_|_){// string 762 + } 763 + 1: (_|_){// 〈1;#exportsObject〉 764 + } 765 + }) } 766 + #exports: (_){ matchN(1, (#list){ 767 + 0: (_|_){// string 768 + } 769 + 1: (_|_){// 〈1;#exportsObject〉 770 + } 771 + }) } 772 + #exportsObject: (#struct){ 773 + exp1?: (_){ matchN(1, (#list){ 774 + 0: (_|_){// string 775 + } 776 + 1: (_|_){// 〈1;#exportsObject〉 777 + } 778 + }) } 779 + } 780 + } 781 + out: (#struct){ 782 + exports: (struct){ 783 + exp1: (string){ "./main-module.js" } 784 + } 785 + #exports: (_){ matchN(1, (#list){ 786 + 0: (_|_){// string 787 + } 788 + 1: (_|_){// 〈1;#exportsObject〉 789 + } 790 + }) } 791 + #exportsObject: (#struct){ 792 + exp1?: (_){ matchN(1, (#list){ 793 + 0: (_|_){// string 794 + } 795 + 1: (_|_){// 〈1;#exportsObject〉 796 + } 797 + }) } 798 + } 799 + } 800 + } 801 + err5: (_|_){ 802 + // [eval] 803 + #Schema: (#struct){ 804 + exports?: (_){ matchN(1, (#list){ 805 + 0: (_|_){// null 806 + } 807 + 1: (_|_){// 〈1;#exportsObject〉 808 + } 809 + }) } 810 + #exports: (_){ matchN(1, (#list){ 811 + 0: (_|_){// null 812 + } 813 + 1: (_|_){// 〈1;#exportsObject〉 814 + } 815 + }) } 816 + #exportsObject: (#struct){ 817 + exp1?: (_){ matchN(1, (#list){ 818 + 0: (_|_){// null 819 + } 820 + 1: (_|_){// 〈1;#exportsObject〉 821 + } 822 + }) } 823 + } 824 + } 825 + out: (_|_){ 826 + // [eval] 827 + exports: (_|_){ 828 + // [eval] closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 829 + // ./closedness.cue:80:13 830 + // ./closedness.cue:80:24 831 + // ./closedness.cue:85:7 832 + // ./closedness.cue:86:12 833 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 834 + // ./closedness.cue:80:30 835 + // ./closedness.cue:81:24 836 + // ./closedness.cue:82:26 837 + // ./closedness.cue:85:7 838 + // ./closedness.cue:86:18 839 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 840 + // ./closedness.cue:80:30 841 + // ./closedness.cue:81:30 842 + // ./closedness.cue:82:19 843 + // ./closedness.cue:82:26 844 + // ./closedness.cue:85:7 845 + // ./closedness.cue:86:18 846 + // closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 847 + // ./closedness.cue:80:13 848 + // ./closedness.cue:80:20 849 + // ./closedness.cue:86:12 850 + // closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 851 + // ./closedness.cue:81:13 852 + // ./closedness.cue:81:20 853 + // ./closedness.cue:82:26 854 + // ./closedness.cue:86:18 855 + exp1: (string){ "./main-module.js" } 856 + } 857 + #exports: (_){ matchN(1, (#list){ 858 + 0: (_|_){// null 859 + } 860 + 1: (_|_){// 〈1;#exportsObject〉 861 + } 862 + }) } 863 + #exportsObject: (#struct){ 864 + exp1?: (_){ matchN(1, (#list){ 865 + 0: (_|_){// null 866 + } 867 + 1: (_|_){// 〈1;#exportsObject〉 868 + } 869 + }) } 870 + } 871 + } 872 + } 873 + } 420 874 #Foo: (#struct){ 421 875 a: (int){ int } 422 876 } ··· 929 1383 } 930 1384 -- out/evalalpha -- 931 1385 Errors: 1386 + closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 1387 + ./closedness.cue:80:13 1388 + ./closedness.cue:80:24 1389 + ./closedness.cue:86:12 1390 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 1391 + ./closedness.cue:81:24 1392 + ./closedness.cue:86:18 1393 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 1394 + ./closedness.cue:82:19 1395 + ./closedness.cue:86:18 1396 + explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 1397 + ./closedness.cue:33:6 1398 + ./closedness.cue:33:17 1399 + ./closedness.cue:36:6 932 1400 incomplete.err1.x.bar: conflicting values 2 and string (mismatched types int and string): 933 1401 ./incomplete.cue:34:24 934 1402 ./incomplete.cue:35:11 ··· 947 1415 match.singleErr.a: conflicting values "foo" and int (mismatched types string and int): 948 1416 ./in.cue:4:5 949 1417 ./in.cue:10:16 1418 + openArguments.ok1.out.a: conflicting values "all" and {baz:"allowed"} (mismatched types string and struct): 1419 + ./closedness.cue:13:6 1420 + ./closedness.cue:13:17 1421 + ./closedness.cue:16:6 1422 + openArguments.ok1.out.a: invalid value {baz:"allowed"} (does not satisfy matchN): 0 matched, expected 1: 1423 + ./closedness.cue:13:6 1424 + ./closedness.cue:13:13 1425 + ./closedness.cue:16:6 1426 + openArguments.ok1.out.a.baz: field not allowed: 1427 + ./closedness.cue:13:6 1428 + ./closedness.cue:16:11 1429 + explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 1430 + ./closedness.cue:33:6 1431 + ./closedness.cue:33:13 1432 + ./closedness.cue:36:6 1433 + explicitClose.err1.out.a.baz: field not allowed: 1434 + ./closedness.cue:33:6 1435 + ./closedness.cue:36:11 1436 + explicitClose.err1.out.a.baz: field not allowed: 1437 + ./closedness.cue:33:24 1438 + ./closedness.cue:36:11 1439 + closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 1440 + ./closedness.cue:80:13 1441 + ./closedness.cue:80:20 1442 + ./closedness.cue:86:12 1443 + closedByDefinition.err5.out.exports.exp1: field not allowed: 1444 + ./closedness.cue:80:13 1445 + ./closedness.cue:86:18 1446 + closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 1447 + ./closedness.cue:81:13 1448 + ./closedness.cue:81:20 1449 + ./closedness.cue:82:26 1450 + ./closedness.cue:86:18 950 1451 match.singleErr: invalid value {a:"foo"} (does not satisfy matchN): 0 matched, expected 1: 951 1452 ./in.cue:8:17 952 1453 ./in.cue:8:24 ··· 1062 1563 Result: 1063 1564 (_|_){ 1064 1565 // [eval] 1566 + ellipsis: (struct){ 1567 + ok: (struct){ 1568 + out: (#struct){ 1569 + field: (#struct){ 1570 + shouldBeAllowed: (int){ 123 } 1571 + } 1572 + #anything: (_){ matchN(1, (#list){ 1573 + 0: (_|_){// [d]&[{ 1574 + // ... 1575 + // }] 1576 + } 1577 + }) } 1578 + } 1579 + #Schema: (#struct){ 1580 + field?: (_){ matchN(1, (#list){ 1581 + 0: (_|_){// { 1582 + // ... 1583 + // } 1584 + } 1585 + }) } 1586 + #anything: (_){ matchN(1, (#list){ 1587 + 0: (_|_){// { 1588 + // ... 1589 + // } 1590 + } 1591 + }) } 1592 + } 1593 + } 1594 + } 1595 + openArguments: (_|_){ 1596 + // [eval] 1597 + ok1: (_|_){ 1598 + // [eval] 1599 + #Schema: (#struct){ 1600 + a: (_){ matchN(1, (#list){ 1601 + 0: (_|_){// "all" 1602 + } 1603 + 1: (_|_){// { 1604 + // foo: "bar" 1605 + // } 1606 + } 1607 + }) } 1608 + } 1609 + out: (_|_){ 1610 + // [eval] 1611 + a: (_|_){ 1612 + // [eval] openArguments.ok1.out.a: conflicting values "all" and {baz:"allowed"} (mismatched types string and struct): 1613 + // ./closedness.cue:13:6 1614 + // ./closedness.cue:13:17 1615 + // ./closedness.cue:16:6 1616 + // openArguments.ok1.out.a: invalid value {baz:"allowed"} (does not satisfy matchN): 0 matched, expected 1: 1617 + // ./closedness.cue:13:6 1618 + // ./closedness.cue:13:13 1619 + // ./closedness.cue:16:6 1620 + // openArguments.ok1.out.a.baz: field not allowed: 1621 + // ./closedness.cue:13:6 1622 + // ./closedness.cue:16:11 1623 + baz: (string){ "allowed" } 1624 + } 1625 + } 1626 + } 1627 + err2: (struct){ 1628 + #Schema: (#struct){ 1629 + a?: (_){ matchN(1, (#list){ 1630 + 0: (_|_){// null 1631 + } 1632 + 1: (_|_){// { 1633 + // [string]: string 1634 + // } 1635 + } 1636 + 2: (_|_){// { 1637 + // b: { 1638 + // ... 1639 + // } 1640 + // } 1641 + } 1642 + }) } 1643 + } 1644 + out: (#struct){ 1645 + a: (#struct){ 1646 + allowed: (string){ "once" } 1647 + } 1648 + } 1649 + } 1650 + } 1651 + explicitClose: (_|_){ 1652 + // [eval] 1653 + err1: (_|_){ 1654 + // [eval] 1655 + #Schema: (#struct){ 1656 + a: (_){ matchN(1, (#list){ 1657 + 0: (_|_){// "all" 1658 + } 1659 + 1: (_|_){// close({ 1660 + // foo: "bar" 1661 + // }) 1662 + } 1663 + }) } 1664 + } 1665 + out: (_|_){ 1666 + // [eval] 1667 + a: (_|_){ 1668 + // [eval] explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 1669 + // ./closedness.cue:33:6 1670 + // ./closedness.cue:33:17 1671 + // ./closedness.cue:36:6 1672 + // explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 1673 + // ./closedness.cue:33:6 1674 + // ./closedness.cue:33:13 1675 + // ./closedness.cue:36:6 1676 + // explicitClose.err1.out.a.baz: field not allowed: 1677 + // ./closedness.cue:33:6 1678 + // ./closedness.cue:36:11 1679 + // explicitClose.err1.out.a.baz: field not allowed: 1680 + // ./closedness.cue:33:24 1681 + // ./closedness.cue:36:11 1682 + baz: (string){ "notAllowed" } 1683 + } 1684 + } 1685 + } 1686 + ok2: (struct){ 1687 + #Schema: (#struct){ 1688 + a?: (_){ matchN(1, (#list){ 1689 + 0: (_|_){// null 1690 + } 1691 + 1: (_|_){// close({ 1692 + // [string]: string 1693 + // }) 1694 + } 1695 + 2: (_|_){// close({ 1696 + // b: { 1697 + // ... 1698 + // } 1699 + // }) 1700 + } 1701 + }) } 1702 + } 1703 + out: (#struct){ 1704 + a: (#struct){ 1705 + allowed: (string){ "once" } 1706 + } 1707 + } 1708 + } 1709 + } 1710 + mixed: (struct){ 1711 + ok3: (struct){ 1712 + #Schema: (#struct){ 1713 + exports?: (_){ matchN(1, (#list){ 1714 + 0: (_|_){// close({ 1715 + // never?: _ 1716 + // }) 1717 + } 1718 + 1: (_|_){// 〈1;#exportsObject〉 1719 + } 1720 + }) } 1721 + #exports: (_){ matchN(1, (#list){ 1722 + 0: (_|_){// string 1723 + } 1724 + 1: (_|_){// 〈1;#exportsObject〉 1725 + } 1726 + }) } 1727 + #exportsObject: (#struct){ 1728 + exp1?: (_){ matchN(1, (#list){ 1729 + 0: (_|_){// string 1730 + } 1731 + 1: (_|_){// 〈1;#exportsObject〉 1732 + } 1733 + }) } 1734 + } 1735 + } 1736 + out: (#struct){ 1737 + exports: (#struct){ 1738 + exp1: (string){ "./main-module.js" } 1739 + } 1740 + #exports: (_){ matchN(1, (#list){ 1741 + 0: (_|_){// [d]&[string] 1742 + } 1743 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1744 + } 1745 + }) } 1746 + #exportsObject: (#struct){ 1747 + exp1?: (_){ matchN(1, (#list){ 1748 + 0: (_|_){// [d]&[string] 1749 + } 1750 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1751 + } 1752 + }) } 1753 + } 1754 + } 1755 + } 1756 + } 1757 + closedByDefinition: (_|_){ 1758 + // [eval] 1759 + ok4: (struct){ 1760 + #Schema: (#struct){ 1761 + exports?: (_){ matchN(1, (#list){ 1762 + 0: (_|_){// string 1763 + } 1764 + 1: (_|_){// 〈1;#exportsObject〉 1765 + } 1766 + }) } 1767 + #exports: (_){ matchN(1, (#list){ 1768 + 0: (_|_){// string 1769 + } 1770 + 1: (_|_){// 〈1;#exportsObject〉 1771 + } 1772 + }) } 1773 + #exportsObject: (#struct){ 1774 + exp1?: (_){ matchN(1, (#list){ 1775 + 0: (_|_){// string 1776 + } 1777 + 1: (_|_){// 〈1;#exportsObject〉 1778 + } 1779 + }) } 1780 + } 1781 + } 1782 + out: (#struct){ 1783 + exports: (#struct){ 1784 + exp1: (string){ "./main-module.js" } 1785 + } 1786 + #exports: (_){ matchN(1, (#list){ 1787 + 0: (_|_){// [d]&[string] 1788 + } 1789 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1790 + } 1791 + }) } 1792 + #exportsObject: (#struct){ 1793 + exp1?: (_){ matchN(1, (#list){ 1794 + 0: (_|_){// [d]&[string] 1795 + } 1796 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1797 + } 1798 + }) } 1799 + } 1800 + } 1801 + } 1802 + err5: (_|_){ 1803 + // [eval] 1804 + #Schema: (#struct){ 1805 + exports?: (_){ matchN(1, (#list){ 1806 + 0: (_|_){// null 1807 + } 1808 + 1: (_|_){// 〈1;#exportsObject〉 1809 + } 1810 + }) } 1811 + #exports: (_){ matchN(1, (#list){ 1812 + 0: (_|_){// null 1813 + } 1814 + 1: (_|_){// 〈1;#exportsObject〉 1815 + } 1816 + }) } 1817 + #exportsObject: (#struct){ 1818 + exp1?: (_){ matchN(1, (#list){ 1819 + 0: (_|_){// null 1820 + } 1821 + 1: (_|_){// 〈1;#exportsObject〉 1822 + } 1823 + }) } 1824 + } 1825 + } 1826 + out: (_|_){ 1827 + // [eval] 1828 + exports: (_|_){ 1829 + // [eval] closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 1830 + // ./closedness.cue:80:13 1831 + // ./closedness.cue:80:24 1832 + // ./closedness.cue:86:12 1833 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 1834 + // ./closedness.cue:81:24 1835 + // ./closedness.cue:86:18 1836 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 1837 + // ./closedness.cue:82:19 1838 + // ./closedness.cue:86:18 1839 + // closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 1840 + // ./closedness.cue:80:13 1841 + // ./closedness.cue:80:20 1842 + // ./closedness.cue:86:12 1843 + // closedByDefinition.err5.out.exports.exp1: field not allowed: 1844 + // ./closedness.cue:80:13 1845 + // ./closedness.cue:86:18 1846 + // closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 1847 + // ./closedness.cue:81:13 1848 + // ./closedness.cue:81:20 1849 + // ./closedness.cue:82:26 1850 + // ./closedness.cue:86:18 1851 + exp1: (string){ "./main-module.js" } 1852 + } 1853 + #exports: (_){ matchN(1, (#list){ 1854 + 0: (_|_){// [d]&[null] 1855 + } 1856 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1857 + } 1858 + }) } 1859 + #exportsObject: (#struct){ 1860 + exp1?: (_){ matchN(1, (#list){ 1861 + 0: (_|_){// [d]&[null] 1862 + } 1863 + 1: (_|_){// [d]&[〈1;#exportsObject〉] 1864 + } 1865 + }) } 1866 + } 1867 + } 1868 + } 1869 + } 1065 1870 #Foo: (#struct){ 1066 1871 a: (int){ int } 1067 1872 } ··· 1558 2363 diff old new 1559 2364 --- old 1560 2365 +++ new 1561 - @@ -9,18 +9,13 @@ 2366 + @@ -2,26 +2,16 @@ 2367 + closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 2368 + ./closedness.cue:80:13 2369 + ./closedness.cue:80:24 2370 + - ./closedness.cue:85:7 2371 + ./closedness.cue:86:12 2372 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 2373 + - ./closedness.cue:80:30 2374 + ./closedness.cue:81:24 2375 + - ./closedness.cue:82:26 2376 + - ./closedness.cue:85:7 2377 + ./closedness.cue:86:18 2378 + closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 2379 + - ./closedness.cue:80:30 2380 + - ./closedness.cue:81:30 2381 + ./closedness.cue:82:19 2382 + - ./closedness.cue:82:26 2383 + - ./closedness.cue:85:7 2384 + ./closedness.cue:86:18 2385 + explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 2386 + - ./closedness.cue:32:12 2387 + ./closedness.cue:33:6 2388 + ./closedness.cue:33:17 2389 + - ./closedness.cue:35:7 2390 + ./closedness.cue:36:6 2391 + incomplete.err1.x.bar: conflicting values 2 and string (mismatched types int and string): 2392 + ./incomplete.cue:34:24 2393 + @@ -33,29 +23,25 @@ 1562 2394 ./incomplete.cue:51:25 1563 2395 ./incomplete.cue:52:11 1564 2396 match.defaults.pickNested1Err.a: conflicting values 2 and 3: ··· 1575 2407 - ./in.cue:8:17 1576 2408 - ./in.cue:8:28 1577 2409 ./in.cue:10:16 1578 - match.singleErr: invalid value {a:"foo"} (does not satisfy matchN): 0 matched, expected 1: 1579 - ./in.cue:8:17 1580 - @@ -113,17 +108,6 @@ 2410 + -openArguments.err2.out.a: conflicting values null and {allowed:"once"} (mismatched types null and struct): 2411 + - ./closedness.cue:20:12 2412 + - ./closedness.cue:21:13 2413 + - ./closedness.cue:22:5 2414 + - ./closedness.cue:27:7 2415 + - ./closedness.cue:28:6 2416 + -openArguments.err2.out.a: invalid value {allowed:"once"} (does not satisfy matchN): 2 matched, expected 1: 2417 + - ./closedness.cue:21:13 2418 + - ./closedness.cue:21:20 2419 + - ./closedness.cue:28:6 2420 + +openArguments.ok1.out.a: conflicting values "all" and {baz:"allowed"} (mismatched types string and struct): 2421 + + ./closedness.cue:13:6 2422 + + ./closedness.cue:13:17 2423 + + ./closedness.cue:16:6 2424 + +openArguments.ok1.out.a: invalid value {baz:"allowed"} (does not satisfy matchN): 0 matched, expected 1: 2425 + + ./closedness.cue:13:6 2426 + + ./closedness.cue:13:13 2427 + + ./closedness.cue:16:6 2428 + +openArguments.ok1.out.a.baz: field not allowed: 2429 + + ./closedness.cue:13:6 2430 + + ./closedness.cue:16:11 2431 + explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 2432 + ./closedness.cue:33:6 2433 + ./closedness.cue:33:13 2434 + @@ -62,15 +48,17 @@ 2435 + ./closedness.cue:36:6 2436 + explicitClose.err1.out.a.baz: field not allowed: 2437 + ./closedness.cue:33:6 2438 + - ./closedness.cue:32:12 2439 + + ./closedness.cue:36:11 2440 + +explicitClose.err1.out.a.baz: field not allowed: 2441 + ./closedness.cue:33:24 2442 + - ./closedness.cue:33:30 2443 + - ./closedness.cue:35:7 2444 + ./closedness.cue:36:11 2445 + closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 2446 + ./closedness.cue:80:13 2447 + ./closedness.cue:80:20 2448 + ./closedness.cue:86:12 2449 + +closedByDefinition.err5.out.exports.exp1: field not allowed: 2450 + + ./closedness.cue:80:13 2451 + + ./closedness.cue:86:18 2452 + closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 2453 + ./closedness.cue:81:13 2454 + ./closedness.cue:81:20 2455 + @@ -167,17 +155,6 @@ 1581 2456 ./in.cue:106:20 1582 2457 ./in.cue:106:67 1583 2458 ./in.cue:109:17 ··· 1595 2470 incomplete.err1.x: invalid value {bar:2} (does not satisfy matchN): 0 matched, expected 1: 1596 2471 ./incomplete.cue:34:6 1597 2472 ./incomplete.cue:34:13 1598 - @@ -159,8 +143,6 @@ 2473 + @@ -205,13 +182,13 @@ 2474 + ellipsis: (struct){ 2475 + ok: (struct){ 2476 + out: (#struct){ 2477 + - field: (struct){ 2478 + + field: (#struct){ 2479 + shouldBeAllowed: (int){ 123 } 2480 + } 2481 + #anything: (_){ matchN(1, (#list){ 2482 + - 0: (_|_){// { 2483 + - // ... 2484 + - // } 2485 + + 0: (_|_){// [d]&[{ 2486 + + // ... 2487 + + // }] 2488 + } 2489 + }) } 2490 + } 2491 + @@ -233,25 +210,37 @@ 2492 + } 2493 + openArguments: (_|_){ 2494 + // [eval] 2495 + - ok1: (struct){ 2496 + - #Schema: (#struct){ 2497 + - a: (_){ matchN(1, (#list){ 2498 + - 0: (_|_){// "all" 2499 + - } 2500 + - 1: (_|_){// { 2501 + - // foo: "bar" 2502 + - // } 2503 + - } 2504 + - }) } 2505 + - } 2506 + - out: (#struct){ 2507 + - a: (struct){ 2508 + + ok1: (_|_){ 2509 + + // [eval] 2510 + + #Schema: (#struct){ 2511 + + a: (_){ matchN(1, (#list){ 2512 + + 0: (_|_){// "all" 2513 + + } 2514 + + 1: (_|_){// { 2515 + + // foo: "bar" 2516 + + // } 2517 + + } 2518 + + }) } 2519 + + } 2520 + + out: (_|_){ 2521 + + // [eval] 2522 + + a: (_|_){ 2523 + + // [eval] openArguments.ok1.out.a: conflicting values "all" and {baz:"allowed"} (mismatched types string and struct): 2524 + + // ./closedness.cue:13:6 2525 + + // ./closedness.cue:13:17 2526 + + // ./closedness.cue:16:6 2527 + + // openArguments.ok1.out.a: invalid value {baz:"allowed"} (does not satisfy matchN): 0 matched, expected 1: 2528 + + // ./closedness.cue:13:6 2529 + + // ./closedness.cue:13:13 2530 + + // ./closedness.cue:16:6 2531 + + // openArguments.ok1.out.a.baz: field not allowed: 2532 + + // ./closedness.cue:13:6 2533 + + // ./closedness.cue:16:11 2534 + baz: (string){ "allowed" } 2535 + } 2536 + } 2537 + } 2538 + - err2: (_|_){ 2539 + - // [eval] 2540 + + err2: (struct){ 2541 + #Schema: (#struct){ 2542 + a?: (_){ matchN(1, (#list){ 2543 + 0: (_|_){// null 2544 + @@ -268,19 +257,8 @@ 2545 + } 2546 + }) } 2547 + } 2548 + - out: (_|_){ 2549 + - // [eval] 2550 + - a: (_|_){ 2551 + - // [eval] openArguments.err2.out.a: conflicting values null and {allowed:"once"} (mismatched types null and struct): 2552 + - // ./closedness.cue:20:12 2553 + - // ./closedness.cue:21:13 2554 + - // ./closedness.cue:22:5 2555 + - // ./closedness.cue:27:7 2556 + - // ./closedness.cue:28:6 2557 + - // openArguments.err2.out.a: invalid value {allowed:"once"} (does not satisfy matchN): 2 matched, expected 1: 2558 + - // ./closedness.cue:21:13 2559 + - // ./closedness.cue:21:20 2560 + - // ./closedness.cue:28:6 2561 + + out: (#struct){ 2562 + + a: (#struct){ 2563 + allowed: (string){ "once" } 2564 + } 2565 + } 2566 + @@ -304,10 +282,8 @@ 2567 + // [eval] 2568 + a: (_|_){ 2569 + // [eval] explicitClose.err1.out.a: conflicting values "all" and {baz:"notAllowed"} (mismatched types string and struct): 2570 + - // ./closedness.cue:32:12 2571 + // ./closedness.cue:33:6 2572 + // ./closedness.cue:33:17 2573 + - // ./closedness.cue:35:7 2574 + // ./closedness.cue:36:6 2575 + // explicitClose.err1.out.a: invalid value {baz:"notAllowed"} (does not satisfy matchN): 0 matched, expected 1: 2576 + // ./closedness.cue:33:6 2577 + @@ -315,10 +291,9 @@ 2578 + // ./closedness.cue:36:6 2579 + // explicitClose.err1.out.a.baz: field not allowed: 2580 + // ./closedness.cue:33:6 2581 + - // ./closedness.cue:32:12 2582 + + // ./closedness.cue:36:11 2583 + + // explicitClose.err1.out.a.baz: field not allowed: 2584 + // ./closedness.cue:33:24 2585 + - // ./closedness.cue:33:30 2586 + - // ./closedness.cue:35:7 2587 + // ./closedness.cue:36:11 2588 + baz: (string){ "notAllowed" } 2589 + } 2590 + @@ -342,7 +317,7 @@ 2591 + }) } 2592 + } 2593 + out: (#struct){ 2594 + - a: (struct){ 2595 + + a: (#struct){ 2596 + allowed: (string){ "once" } 2597 + } 2598 + } 2599 + @@ -375,20 +350,20 @@ 2600 + } 2601 + } 2602 + out: (#struct){ 2603 + - exports: (struct){ 2604 + - exp1: (string){ "./main-module.js" } 2605 + - } 2606 + - #exports: (_){ matchN(1, (#list){ 2607 + - 0: (_|_){// string 2608 + - } 2609 + - 1: (_|_){// 〈1;#exportsObject〉 2610 + - } 2611 + - }) } 2612 + - #exportsObject: (#struct){ 2613 + - exp1?: (_){ matchN(1, (#list){ 2614 + - 0: (_|_){// string 2615 + - } 2616 + - 1: (_|_){// 〈1;#exportsObject〉 2617 + + exports: (#struct){ 2618 + + exp1: (string){ "./main-module.js" } 2619 + + } 2620 + + #exports: (_){ matchN(1, (#list){ 2621 + + 0: (_|_){// [d]&[string] 2622 + + } 2623 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2624 + + } 2625 + + }) } 2626 + + #exportsObject: (#struct){ 2627 + + exp1?: (_){ matchN(1, (#list){ 2628 + + 0: (_|_){// [d]&[string] 2629 + + } 2630 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2631 + } 2632 + }) } 2633 + } 2634 + @@ -421,20 +396,20 @@ 2635 + } 2636 + } 2637 + out: (#struct){ 2638 + - exports: (struct){ 2639 + - exp1: (string){ "./main-module.js" } 2640 + - } 2641 + - #exports: (_){ matchN(1, (#list){ 2642 + - 0: (_|_){// string 2643 + - } 2644 + - 1: (_|_){// 〈1;#exportsObject〉 2645 + - } 2646 + - }) } 2647 + - #exportsObject: (#struct){ 2648 + - exp1?: (_){ matchN(1, (#list){ 2649 + - 0: (_|_){// string 2650 + - } 2651 + - 1: (_|_){// 〈1;#exportsObject〉 2652 + + exports: (#struct){ 2653 + + exp1: (string){ "./main-module.js" } 2654 + + } 2655 + + #exports: (_){ matchN(1, (#list){ 2656 + + 0: (_|_){// [d]&[string] 2657 + + } 2658 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2659 + + } 2660 + + }) } 2661 + + #exportsObject: (#struct){ 2662 + + exp1?: (_){ matchN(1, (#list){ 2663 + + 0: (_|_){// [d]&[string] 2664 + + } 2665 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2666 + } 2667 + }) } 2668 + } 2669 + @@ -470,25 +445,20 @@ 2670 + // [eval] closedByDefinition.err5.out.exports: conflicting values null and {exp1:"./main-module.js"} (mismatched types null and struct): 2671 + // ./closedness.cue:80:13 2672 + // ./closedness.cue:80:24 2673 + - // ./closedness.cue:85:7 2674 + // ./closedness.cue:86:12 2675 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and null (mismatched types string and null): 2676 + - // ./closedness.cue:80:30 2677 + // ./closedness.cue:81:24 2678 + - // ./closedness.cue:82:26 2679 + - // ./closedness.cue:85:7 2680 + // ./closedness.cue:86:18 2681 + // closedByDefinition.err5.out.exports.exp1: conflicting values "./main-module.js" and {exp1?:#exports} (mismatched types string and struct): 2682 + - // ./closedness.cue:80:30 2683 + - // ./closedness.cue:81:30 2684 + // ./closedness.cue:82:19 2685 + - // ./closedness.cue:82:26 2686 + - // ./closedness.cue:85:7 2687 + // ./closedness.cue:86:18 2688 + // closedByDefinition.err5.out.exports: invalid value {exp1:"./main-module.js"} (does not satisfy matchN): 0 matched, expected 1: 2689 + // ./closedness.cue:80:13 2690 + // ./closedness.cue:80:20 2691 + // ./closedness.cue:86:12 2692 + + // closedByDefinition.err5.out.exports.exp1: field not allowed: 2693 + + // ./closedness.cue:80:13 2694 + + // ./closedness.cue:86:18 2695 + // closedByDefinition.err5.out.exports.exp1: invalid value "./main-module.js" (does not satisfy matchN): 0 matched, expected 1: 2696 + // ./closedness.cue:81:13 2697 + // ./closedness.cue:81:20 2698 + @@ -497,16 +467,16 @@ 2699 + exp1: (string){ "./main-module.js" } 2700 + } 2701 + #exports: (_){ matchN(1, (#list){ 2702 + - 0: (_|_){// null 2703 + - } 2704 + - 1: (_|_){// 〈1;#exportsObject〉 2705 + - } 2706 + - }) } 2707 + - #exportsObject: (#struct){ 2708 + - exp1?: (_){ matchN(1, (#list){ 2709 + - 0: (_|_){// null 2710 + - } 2711 + - 1: (_|_){// 〈1;#exportsObject〉 2712 + + 0: (_|_){// [d]&[null] 2713 + + } 2714 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2715 + + } 2716 + + }) } 2717 + + #exportsObject: (#struct){ 2718 + + exp1?: (_){ matchN(1, (#list){ 2719 + + 0: (_|_){// [d]&[null] 2720 + + } 2721 + + 1: (_|_){// [d]&[〈1;#exportsObject〉] 2722 + } 2723 + }) } 2724 + } 2725 + @@ -524,8 +494,6 @@ 1599 2726 singleErr: (_|_){ 1600 2727 // [eval] match.singleErr.a: conflicting values "foo" and int (mismatched types string and int): 1601 2728 // ./in.cue:4:5 ··· 1604 2731 // ./in.cue:10:16 1605 2732 // match.singleErr: invalid value {a:"foo"} (does not satisfy matchN): 0 matched, expected 1: 1606 2733 // ./in.cue:8:17 1607 - @@ -174,8 +156,6 @@ 2734 + @@ -539,8 +507,6 @@ 1608 2735 incompleteErr: (_|_){ 1609 2736 // [eval] match.incompleteErr.a: conflicting values string and int (mismatched types string and int): 1610 2737 // ./in.cue:4:5 ··· 1613 2740 // ./in.cue:14:20 1614 2741 // match.incompleteErr: invalid value {a:string} (does not satisfy matchN): 0 matched, expected 1: 1615 2742 // ./in.cue:12:21 1616 - @@ -207,7 +187,6 @@ 2743 + @@ -572,7 +538,6 @@ 1617 2744 } 1618 2745 pickNested1Err: (_|_){ 1619 2746 // [eval] match.defaults.pickNested1Err.a: conflicting values 2 and 3: ··· 1621 2748 // ./in.cue:36:38 1622 2749 // ./in.cue:39:23 1623 2750 // match.defaults.pickNested1Err: invalid value {a:*3 | int} (does not satisfy matchN): 0 matched, expected 1: 1624 - @@ -435,10 +414,8 @@ 2751 + @@ -800,10 +765,8 @@ 1625 2752 } 1626 2753 } 1627 2754 } ··· 1634 2761 #x: (_){ matchN(1, (#list){ 1635 2762 0: (_|_){// [ 1636 2763 // {}, 1637 - @@ -445,19 +422,8 @@ 2764 + @@ -810,19 +773,8 @@ 1638 2765 // ] 1639 2766 } 1640 2767 }) } ··· 1656 2783 a: (int){ 1 } 1657 2784 } 1658 2785 } 1659 - @@ -467,7 +433,7 @@ 2786 + @@ -832,7 +784,7 @@ 1660 2787 0: (_|_){// {} 1661 2788 } 1662 2789 }) } ··· 1665 2792 a: (int){ 1 } 1666 2793 } 1667 2794 } 1668 - @@ -640,8 +606,8 @@ 2795 + @@ -1005,8 +957,8 @@ 1669 2796 run?: (string){ string } 1670 2797 } 1671 2798 s: (#struct){ ··· 1679 2806 The old evaluator does not correctly handle ToDataAll if a node is 1680 2807 mid-evaluation. The new evaluator does. 1681 2808 issue3575: the old evaluator was incorrect in behaving differently when using structs inside lists 2809 + closedness.cue: several discrepancies. EvalV3 is correct in all cases. 2810 + -- diff/todo/p1 -- 2811 + openArguments.*: arguments to functions should always be treated as open. 1682 2812 -- diff/todo/p3 -- 1683 2813 Missing error positions. 1684 2814 -- out/compile -- 2815 + --- closedness.cue 2816 + { 2817 + ellipsis: { 2818 + ok: { 2819 + out: (〈0;#Schema〉 & { 2820 + field: { 2821 + shouldBeAllowed: 123 2822 + } 2823 + }) 2824 + #Schema: { 2825 + field?: 〈0;#anything〉 2826 + #anything: matchN(1, [ 2827 + { 2828 + ... 2829 + }, 2830 + ]) 2831 + } 2832 + } 2833 + } 2834 + openArguments: { 2835 + ok1: { 2836 + #Schema: { 2837 + { 2838 + a: matchN(1, [ 2839 + "all", 2840 + { 2841 + foo: "bar" 2842 + }, 2843 + ]) 2844 + } 2845 + } 2846 + out: (〈0;#Schema〉 & { 2847 + a: { 2848 + baz: "allowed" 2849 + } 2850 + }) 2851 + } 2852 + } 2853 + openArguments: { 2854 + err2: { 2855 + #Schema: { 2856 + { 2857 + a?: matchN(1, [ 2858 + null, 2859 + { 2860 + [string]: string 2861 + }, 2862 + { 2863 + b: { 2864 + ... 2865 + } 2866 + }, 2867 + ]) 2868 + } 2869 + } 2870 + out: (〈0;#Schema〉 & { 2871 + a: { 2872 + allowed: "once" 2873 + } 2874 + }) 2875 + } 2876 + } 2877 + explicitClose: { 2878 + err1: { 2879 + #Schema: { 2880 + { 2881 + a: matchN(1, [ 2882 + "all", 2883 + close({ 2884 + foo: "bar" 2885 + }), 2886 + ]) 2887 + } 2888 + } 2889 + out: (〈0;#Schema〉 & { 2890 + a: { 2891 + baz: "notAllowed" 2892 + } 2893 + }) 2894 + } 2895 + } 2896 + explicitClose: { 2897 + ok2: { 2898 + #Schema: { 2899 + { 2900 + a?: matchN(1, [ 2901 + null, 2902 + close({ 2903 + [string]: string 2904 + }), 2905 + close({ 2906 + b: { 2907 + ... 2908 + } 2909 + }), 2910 + ]) 2911 + } 2912 + } 2913 + out: (〈0;#Schema〉 & { 2914 + a: { 2915 + allowed: "once" 2916 + } 2917 + }) 2918 + } 2919 + } 2920 + mixed: { 2921 + ok3: { 2922 + #Schema: { 2923 + exports?: matchN(1, [ 2924 + close({ 2925 + never?: _ 2926 + }), 2927 + 〈1;#exportsObject〉, 2928 + ]) 2929 + #exports: matchN(1, [ 2930 + string, 2931 + 〈1;#exportsObject〉, 2932 + ]) 2933 + #exportsObject: { 2934 + exp1?: 〈1;#exports〉 2935 + } 2936 + } 2937 + out: (〈0;#Schema〉 & { 2938 + exports: { 2939 + exp1: "./main-module.js" 2940 + } 2941 + }) 2942 + } 2943 + } 2944 + closedByDefinition: { 2945 + ok4: { 2946 + #Schema: { 2947 + exports?: matchN(1, [ 2948 + string, 2949 + 〈1;#exportsObject〉, 2950 + ]) 2951 + #exports: matchN(1, [ 2952 + string, 2953 + 〈1;#exportsObject〉, 2954 + ]) 2955 + #exportsObject: { 2956 + exp1?: 〈1;#exports〉 2957 + } 2958 + } 2959 + out: (〈0;#Schema〉 & { 2960 + exports: { 2961 + exp1: "./main-module.js" 2962 + } 2963 + }) 2964 + } 2965 + } 2966 + closedByDefinition: { 2967 + err5: { 2968 + #Schema: { 2969 + exports?: matchN(1, [ 2970 + null, 2971 + 〈1;#exportsObject〉, 2972 + ]) 2973 + #exports: matchN(1, [ 2974 + null, 2975 + 〈1;#exportsObject〉, 2976 + ]) 2977 + #exportsObject: { 2978 + exp1?: 〈1;#exports〉 2979 + } 2980 + } 2981 + out: (〈0;#Schema〉 & { 2982 + exports: { 2983 + exp1: "./main-module.js" 2984 + } 2985 + }) 2986 + } 2987 + } 2988 + } 1685 2989 --- in.cue 1686 2990 { 1687 2991 #Foo: {