this repo has no description
0
fork

Configure Feed

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

cue/testdata: add regression test for issue #2685

This issue was resolved by dynamic flat closedness in
https://cuelang.org/cl/1210790 so we only add a regression test here.

Closes #2685.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I5df1ed2b4d61a37fd6d77ab20d004c5e5409b6d8
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1224701
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+1205 -17
+1205 -17
cue/testdata/disjunctions/elimination.txtar
··· 568 568 } | { 569 569 kind: "B" 570 570 } 571 - 571 + 572 572 out: #Schema 573 573 out: a: { 574 574 kind: "A" ··· 659 659 a: (int | *4) & (int | *1) & (int | *3) & (int | *8) 660 660 b: (int | *4) & (int | *1) & (int | *3) 661 661 } 662 + -- issue2685.cue -- 663 + issue2685: { 664 + #Foo: { 665 + bar: int 666 + opt?: int 667 + } | *{ 668 + opt: int 669 + } 670 + 671 + foo: #Foo 672 + foo: bar: 0 673 + 674 + { 675 + foo: #Foo 676 + } 677 + } 662 678 -- out/evalalpha/stats -- 663 - Leaks: 215 664 - Freed: 2551 665 - Reused: 2513 666 - Allocs: 253 679 + Leaks: 218 680 + Freed: 2563 681 + Reused: 2524 682 + Allocs: 257 667 683 Retain: 0 668 684 669 - Unifications: 658 670 - Conjuncts: 2752 671 - Disjuncts: 1298 685 + Unifications: 667 686 + Conjuncts: 2771 687 + Disjuncts: 1302 672 688 Notifications: 4 673 689 674 - NumCloseIDs: 319 690 + NumCloseIDs: 323 675 691 -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 676 692 diff old new 677 693 --- old ··· 690 706 -MisalignedConjunct: 44 691 707 - 692 708 -NumCloseIDs: 10 693 - +Leaks: 215 694 - +Freed: 2551 695 - +Reused: 2513 696 - +Allocs: 253 709 + +Leaks: 218 710 + +Freed: 2563 711 + +Reused: 2524 712 + +Allocs: 257 697 713 +Retain: 0 698 714 + 699 - +Unifications: 658 700 - +Conjuncts: 2752 701 - +Disjuncts: 1298 715 + +Unifications: 667 716 + +Conjuncts: 2771 717 + +Disjuncts: 1302 702 718 +Notifications: 4 703 719 + 704 - +NumCloseIDs: 319 720 + +NumCloseIDs: 323 705 721 -- out/eval/stats -- 706 722 Leaks: 9 707 723 Freed: 2856 ··· 724 740 issue1417: new evaluator fixes known bug 725 741 issue3149: new evaluator fixes known bug 726 742 issue770: new evaluator fixes a bug in "c" and "coo" where defaults did not apply correctly. 743 + -- out/evalalpha -- 744 + (struct){ 745 + disambiguateClosed: (struct){ 746 + b: (#struct){ |((#struct){ 747 + x: (bool){ true } 748 + }, (#struct){ 749 + y: (bool){ true } 750 + }) } 751 + a: (#struct){ |((#struct){ 752 + x: (bool){ true } 753 + }, (#struct){ 754 + y: (bool){ true } 755 + }) } 756 + #Def: (#struct){ |((#struct){ 757 + x: (bool){ true } 758 + }, (#struct){ 759 + y: (bool){ true } 760 + }) } 761 + } 762 + alwaysCheckMatchers1: (struct){ 763 + b: (struct){ 764 + c: (string){ "yyyyy" } 765 + } 766 + } 767 + alwaysCheckPatterns2: (struct){ 768 + a: (#struct){ 769 + c: (string){ "yyyyy" } 770 + } 771 + b: (#struct){ 772 + c: (string){ "yyyyy" } 773 + } 774 + #X: ((string|struct)){ |((string){ string }, (#struct){ 775 + c: (string){ string } 776 + }) } 777 + } 778 + nestedNonMonotonic: (struct){ 779 + resolved: (struct){ 780 + n1: (struct){ 781 + x: ((null|struct)){ |((struct){ 782 + a: (struct){ 783 + c: (int){ 1 } 784 + d: (int){ 1 } 785 + } 786 + }, (null){ null }) } 787 + } 788 + n2: (struct){ 789 + x: ((null|struct)){ |((struct){ 790 + a: (struct){ 791 + b: (struct){ 792 + c: (int){ 1 } 793 + d: (int){ 1 } 794 + } 795 + } 796 + }, (null){ null }) } 797 + } 798 + } 799 + eliminated: (struct){ 800 + n1: (struct){ 801 + p1: (struct){ 802 + x: (null){ null } 803 + } 804 + p2: (struct){ 805 + x: (null){ null } 806 + } 807 + } 808 + n2: (struct){ 809 + p1: (struct){ 810 + x: (null){ null } 811 + } 812 + p2: (struct){ 813 + x: (null){ null } 814 + } 815 + } 816 + } 817 + incomplete: (struct){ 818 + a: (struct){ 819 + n1: (struct){ 820 + p1: (struct){ 821 + x: (null){ null } 822 + } 823 + p2: (struct){ 824 + x: (null){ null } 825 + } 826 + } 827 + n2: (struct){ 828 + p1: (struct){ 829 + x: ((null|struct)){ |((struct){ 830 + a: (struct){ 831 + b: (_|_){ 832 + // [incomplete] nestedNonMonotonic.incomplete.a.n2.p1.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2): 833 + // ./in.cue:96:15 834 + // ./in.cue:96:32 835 + // ./in.cue:97:12 836 + c: (int){ 1 } 837 + } 838 + } 839 + }, (null){ null }) } 840 + } 841 + p2: (struct){ 842 + x: ((null|struct)){ |((struct){ 843 + a: (struct){ 844 + b: (_|_){ 845 + // [incomplete] nestedNonMonotonic.incomplete.a.n2.p2.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2): 846 + // ./in.cue:102:15 847 + // ./in.cue:101:12 848 + // ./in.cue:102:32 849 + c: (int){ 1 } 850 + } 851 + } 852 + }, (null){ null }) } 853 + } 854 + } 855 + } 856 + b: (struct){ 857 + n1: (struct){ 858 + p1: (struct){ 859 + x: (null){ null } 860 + } 861 + p2: (struct){ 862 + x: (null){ null } 863 + } 864 + p3: (struct){ 865 + x: (null){ null } 866 + } 867 + } 868 + n2: (struct){ 869 + p1: (struct){ 870 + x: ((null|struct)){ |((struct){ 871 + a: (struct){ 872 + b: (_|_){ 873 + // [incomplete] nestedNonMonotonic.incomplete.b.n2.p1.x.a.b: invalid value {c:1,d:1} (does not satisfy struct.MinFields(3)): len(fields) < MinFields(3) (2 < 3): 874 + // ./in.cue:138:15 875 + // ./in.cue:124:15 876 + // ./in.cue:125:12 877 + // ./in.cue:126:12 878 + // ./in.cue:130:12 879 + // ./in.cue:131:15 880 + // ./in.cue:132:12 881 + // ./in.cue:136:12 882 + // ./in.cue:137:12 883 + // ./in.cue:138:32 884 + c: (int){ 1 } 885 + d: (int){ 1 } 886 + } 887 + } 888 + }, (null){ null }) } 889 + } 890 + } 891 + } 892 + } 893 + } 894 + preserveClosedness: (struct){ 895 + small: (struct){ 896 + p1: (struct){ 897 + #A: (#struct){ |(*(#struct){ 898 + a: (string){ string } 899 + }, (#struct){ 900 + a: (string){ string } 901 + b: (int){ int } 902 + }) } 903 + #B: (#struct){ |(*(#struct){ 904 + }, (#struct){ 905 + b: (int){ int } 906 + }, (#struct){ 907 + a: (string){ string } 908 + }, (#struct){ 909 + a: (string){ string } 910 + b: (int){ int } 911 + }) } 912 + } 913 + p2: (struct){ 914 + #A: (#struct){ |(*(#struct){ 915 + a: (string){ string } 916 + }, (#struct){ 917 + a: (string){ string } 918 + b: (int){ int } 919 + }) } 920 + #B: (#struct){ |(*(#struct){ 921 + }, (#struct){ 922 + a: (string){ string } 923 + b: (int){ int } 924 + }, (#struct){ 925 + a: (string){ string } 926 + }, (#struct){ 927 + b: (int){ int } 928 + }) } 929 + } 930 + } 931 + medium: (struct){ 932 + p1: (struct){ 933 + #A: (#struct){ |(*(#struct){ 934 + a: (string){ string } 935 + }, (#struct){ 936 + a: (string){ string } 937 + c: (int){ int } 938 + }, (#struct){ 939 + a: (string){ string } 940 + d: (string){ string } 941 + }) } 942 + #B: (#struct){ |(*(#struct){ 943 + }, (#struct){ 944 + c: (int){ int } 945 + }, (#struct){ 946 + d: (string){ string } 947 + }, (#struct){ 948 + a: (string){ string } 949 + }, (#struct){ 950 + a: (string){ string } 951 + c: (int){ int } 952 + }, (#struct){ 953 + a: (string){ string } 954 + d: (string){ string } 955 + }, (#struct){ 956 + b: (string){ string } 957 + }, (#struct){ 958 + b: (string){ string } 959 + c: (int){ int } 960 + }, (#struct){ 961 + b: (string){ string } 962 + d: (string){ string } 963 + }) } 964 + } 965 + p2: (struct){ 966 + #A: (#struct){ |(*(#struct){ 967 + a: (string){ string } 968 + }, (#struct){ 969 + a: (string){ string } 970 + c: (int){ int } 971 + }, (#struct){ 972 + a: (string){ string } 973 + d: (string){ string } 974 + }) } 975 + #B: (#struct){ |(*(#struct){ 976 + }, (#struct){ 977 + a: (string){ string } 978 + c: (int){ int } 979 + }, (#struct){ 980 + a: (string){ string } 981 + d: (string){ string } 982 + }, (#struct){ 983 + a: (string){ string } 984 + }, (#struct){ 985 + c: (int){ int } 986 + }, (#struct){ 987 + d: (string){ string } 988 + }, (#struct){ 989 + b: (string){ string } 990 + }, (#struct){ 991 + b: (string){ string } 992 + c: (int){ int } 993 + }, (#struct){ 994 + b: (string){ string } 995 + d: (string){ string } 996 + }) } 997 + } 998 + p3: (struct){ 999 + #A: (#struct){ |(*(#struct){ 1000 + a: (string){ string } 1001 + }, (#struct){ 1002 + a: (string){ string } 1003 + c: (int){ int } 1004 + }, (#struct){ 1005 + a: (string){ string } 1006 + d: (string){ string } 1007 + }) } 1008 + #B: (#struct){ |(*(#struct){ 1009 + }, (#struct){ 1010 + a: (string){ string } 1011 + c: (int){ int } 1012 + }, (#struct){ 1013 + a: (string){ string } 1014 + d: (string){ string } 1015 + }, (#struct){ 1016 + b: (string){ string } 1017 + }, (#struct){ 1018 + b: (string){ string } 1019 + c: (int){ int } 1020 + }, (#struct){ 1021 + b: (string){ string } 1022 + d: (string){ string } 1023 + }, (#struct){ 1024 + a: (string){ string } 1025 + }, (#struct){ 1026 + c: (int){ int } 1027 + }, (#struct){ 1028 + d: (string){ string } 1029 + }) } 1030 + } 1031 + } 1032 + } 1033 + noChildError: (struct){ 1034 + issue1608: (struct){ 1035 + myValue: (#struct){ 1036 + fieldName: (string){ "some string" } 1037 + } 1038 + #type: (#struct){ 1039 + fieldName: ((string|struct)){ |((string){ string }, (#struct){ 1040 + foo: (string){ string } 1041 + }) } 1042 + } 1043 + #subtype: ((string|struct)){ |((string){ string }, (#struct){ 1044 + foo: (string){ string } 1045 + }) } 1046 + } 1047 + t1: (struct){ 1048 + #D: (#struct){ 1049 + b: (string){ string } 1050 + } 1051 + o: (#struct){ 1052 + b: (string){ "test" } 1053 + } 1054 + } 1055 + t2: (struct){ 1056 + o: (#struct){ 1057 + b: (string){ "test" } 1058 + } 1059 + #D: (#struct){ 1060 + b: (string){ string } 1061 + } 1062 + } 1063 + t3: (struct){ 1064 + #D: (#struct){ |((#struct){ 1065 + a: (null){ null } 1066 + }, (#struct){ 1067 + b: (string){ string } 1068 + }) } 1069 + o: (#struct){ 1070 + b: (string){ "test" } 1071 + } 1072 + } 1073 + t4: (struct){ 1074 + o: (#struct){ 1075 + b: (string){ "test" } 1076 + } 1077 + #D: (#struct){ |((#struct){ 1078 + a: (null){ null } 1079 + }, (#struct){ 1080 + b: (string){ string } 1081 + }) } 1082 + } 1083 + } 1084 + issue1924: (struct){ 1085 + t1: (struct){ 1086 + m: (struct){ 1087 + a: (int){ 2 } 1088 + } 1089 + x: (int){ 2 } 1090 + } 1091 + t2: (struct){ 1092 + m: (struct){ 1093 + a: (int){ 2 } 1094 + } 1095 + x: (int){ 3 } 1096 + } 1097 + t3: (struct){ 1098 + m: (struct){ 1099 + a: (int){ 2 } 1100 + } 1101 + x: (int){ 1 } 1102 + } 1103 + } 1104 + issue1838: (struct){ 1105 + t1: (struct){ 1106 + p?: (#list){ 1107 + } 1108 + a: (null){ null } 1109 + } 1110 + t2: (struct){ 1111 + p?: (#list){ 1112 + } 1113 + a: (null){ null } 1114 + } 1115 + } 1116 + noHang: (struct){ 1117 + #T: (list){ 1118 + 0: (string){ "d" } 1119 + } 1120 + x: ~(noHang.#T) 1121 + #X: ~(noHang.#T) 1122 + } 1123 + issue1940: (struct){ 1124 + #T: (#list){ 1125 + 0: (string){ "d" } 1126 + 1: (list){ 1127 + } 1128 + } 1129 + #A: (#struct){ 1130 + type: ~(issue1940.#T) 1131 + } 1132 + #B: (#struct){ 1133 + } 1134 + #C: (#struct){ 1135 + x: ~(issue1940.#A) 1136 + } 1137 + } 1138 + issue1417: (struct){ 1139 + #ID: (string){ |((string){ &(!~"^a", =~"^a") }, (string){ &(!~"^a", !~"[A-Z]") }, (string){ &(=~"^ab$", =~"^a") }, (string){ &(=~"^ab$", !~"[A-Z]") }, (string){ &(=~"^aB$", =~"^a") }, (string){ &(=~"^aB$", !~"[A-Z]") }) } 1140 + ids: (#list){ 1141 + 0: (string){ "xyz" } 1142 + 1: (string){ "ab" } 1143 + 2: (string){ "aB" } 1144 + } 1145 + } 1146 + issue2209: (struct){ 1147 + simplified: (struct){ 1148 + t1: (struct){ 1149 + #SpecFoo: (#struct){ 1150 + foo: (#struct){ 1151 + min: (int){ 1 } 1152 + } 1153 + } 1154 + #SpecBar: (#struct){ 1155 + bar: (#struct){ 1156 + min: (int){ 1 } 1157 + } 1158 + } 1159 + spec: (#struct){ 1160 + bar: (#struct){ 1161 + min: (int){ 1 } 1162 + } 1163 + } 1164 + out: (struct){ |((struct){ 1165 + minBar: (int){ 1 } 1166 + X: ~(issue2209.simplified.t1.spec) 1167 + nullFoo: (null){ null } 1168 + minFoo: (int){ int } 1169 + }, (struct){ 1170 + minBar: (int){ 1 } 1171 + X: ~(issue2209.simplified.t1.spec) 1172 + nullFoo: (null){ null } 1173 + }, (struct){ 1174 + minBar: (int){ 1 } 1175 + X: ~(issue2209.simplified.t1.spec) 1176 + nullBar: (null){ null } 1177 + minFoo: (int){ int } 1178 + }, (struct){ 1179 + minBar: (int){ 1 } 1180 + X: ~(issue2209.simplified.t1.spec) 1181 + nullBar: (null){ null } 1182 + }) } 1183 + } 1184 + t2: (struct){ |((struct){ 1185 + #SpecFoo: (#struct){ 1186 + foo: (#struct){ 1187 + } 1188 + } 1189 + #SpecBar: (#struct){ 1190 + bar: (#struct){ 1191 + x: (int){ 1 } 1192 + } 1193 + } 1194 + spec: (#struct){ 1195 + bar: (#struct){ 1196 + x: (int){ 1 } 1197 + } 1198 + } 1199 + BAZ: (int){ 1 } 1200 + f1: (int){ int } 1201 + f2: (int){ int } 1202 + }, (struct){ 1203 + #SpecFoo: (#struct){ 1204 + foo: (#struct){ 1205 + } 1206 + } 1207 + #SpecBar: (#struct){ 1208 + bar: (#struct){ 1209 + x: (int){ 1 } 1210 + } 1211 + } 1212 + spec: (#struct){ 1213 + bar: (#struct){ 1214 + x: (int){ 1 } 1215 + } 1216 + } 1217 + BAZ: (int){ 1 } 1218 + f1: (int){ int } 1219 + b2: (int){ int } 1220 + }, (struct){ 1221 + #SpecFoo: (#struct){ 1222 + foo: (#struct){ 1223 + } 1224 + } 1225 + #SpecBar: (#struct){ 1226 + bar: (#struct){ 1227 + x: (int){ 1 } 1228 + } 1229 + } 1230 + spec: (#struct){ 1231 + bar: (#struct){ 1232 + x: (int){ 1 } 1233 + } 1234 + } 1235 + BAZ: (int){ 1 } 1236 + b2: (int){ int } 1237 + f2: (int){ int } 1238 + }, (struct){ 1239 + #SpecFoo: (#struct){ 1240 + foo: (#struct){ 1241 + } 1242 + } 1243 + #SpecBar: (#struct){ 1244 + bar: (#struct){ 1245 + x: (int){ 1 } 1246 + } 1247 + } 1248 + spec: (#struct){ 1249 + bar: (#struct){ 1250 + x: (int){ 1 } 1251 + } 1252 + } 1253 + BAZ: (int){ 1 } 1254 + b2: (int){ int } 1255 + }) } 1256 + t3: (struct){ |((struct){ 1257 + #A: (#struct){ 1258 + v: (int){ 1 } 1259 + } 1260 + BAZ: (int){ 1 } 1261 + S: (#struct){ 1262 + x: (int){ 1 } 1263 + y: (int){ 1 } 1264 + } 1265 + #B: (#struct){ 1266 + x: (int){ 1 } 1267 + y: (int){ 1 } 1268 + } 1269 + f1: (int){ int } 1270 + f2: (int){ int } 1271 + }, (struct){ 1272 + #A: (#struct){ 1273 + v: (int){ 1 } 1274 + } 1275 + BAZ: (int){ 1 } 1276 + S: (#struct){ 1277 + x: (int){ 1 } 1278 + y: (int){ 1 } 1279 + } 1280 + #B: (#struct){ 1281 + x: (int){ 1 } 1282 + y: (int){ 1 } 1283 + } 1284 + f1: (int){ int } 1285 + b2: (int){ int } 1286 + }, (struct){ 1287 + #A: (#struct){ 1288 + v: (int){ 1 } 1289 + } 1290 + BAZ: (int){ 1 } 1291 + S: (#struct){ 1292 + x: (int){ 1 } 1293 + y: (int){ 1 } 1294 + } 1295 + #B: (#struct){ 1296 + x: (int){ 1 } 1297 + y: (int){ 1 } 1298 + } 1299 + b2: (int){ int } 1300 + f2: (int){ int } 1301 + }, (struct){ 1302 + #A: (#struct){ 1303 + v: (int){ 1 } 1304 + } 1305 + BAZ: (int){ 1 } 1306 + S: (#struct){ 1307 + x: (int){ 1 } 1308 + y: (int){ 1 } 1309 + } 1310 + #B: (#struct){ 1311 + x: (int){ 1 } 1312 + y: (int){ 1 } 1313 + } 1314 + b2: (int){ int } 1315 + }) } 1316 + } 1317 + full: (struct){ 1318 + Foo: (#struct){ 1319 + spec: (#struct){ 1320 + foo: (#struct){ 1321 + min: (int){ |(*(int){ 10 }, (int){ int }) } 1322 + max: (int){ |(*(int){ 20 }, (int){ int }) } 1323 + } 1324 + } 1325 + resource: (#struct){ 1326 + _X: (#struct){ 1327 + spec: ~(issue2209.full.Foo.spec) 1328 + } 1329 + spec: (#struct){ |(*(#struct){ 1330 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1331 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1332 + minBar?: (null){ null } 1333 + maxBar?: (null){ null } 1334 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1335 + fuga?: (null){ null } 1336 + }, (#struct){ 1337 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1338 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1339 + minBar?: (null){ null } 1340 + maxBar?: (null){ null } 1341 + hoge?: (null){ null } 1342 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1343 + }) } 1344 + } 1345 + } 1346 + Bar: (#struct){ 1347 + spec: (#struct){ 1348 + bar: (#struct){ 1349 + min: (int){ |(*(int){ 30 }, (int){ int }) } 1350 + max: (int){ |(*(int){ 40 }, (int){ int }) } 1351 + } 1352 + } 1353 + resource: (#struct){ 1354 + _X: (#struct){ 1355 + spec: ~(issue2209.full.Bar.spec) 1356 + } 1357 + spec: (#struct){ |(*(#struct){ 1358 + minFoo?: (null){ null } 1359 + maxFoo?: (null){ null } 1360 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1361 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1362 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1363 + fuga?: (null){ null } 1364 + }, (#struct){ 1365 + minFoo?: (null){ null } 1366 + maxFoo?: (null){ null } 1367 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1368 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1369 + hoge?: (null){ null } 1370 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1371 + }) } 1372 + } 1373 + } 1374 + #Abstract: (#struct){ 1375 + spec: (#struct){ |(*(#struct){ 1376 + foo: (#struct){ 1377 + min: (int){ |(*(int){ 10 }, (int){ int }) } 1378 + max: (int){ |(*(int){ 20 }, (int){ int }) } 1379 + } 1380 + }, (#struct){ 1381 + bar: (#struct){ 1382 + min: (int){ |(*(int){ 30 }, (int){ int }) } 1383 + max: (int){ |(*(int){ 40 }, (int){ int }) } 1384 + } 1385 + }) } 1386 + resource: (#struct){ 1387 + _X: (#struct){ 1388 + spec: (#struct){ |(*(#struct){ 1389 + foo: (#struct){ 1390 + min: (int){ |(*(int){ 10 }, (int){ int }) } 1391 + max: (int){ |(*(int){ 20 }, (int){ int }) } 1392 + } 1393 + }, (#struct){ 1394 + bar: (#struct){ 1395 + min: (int){ |(*(int){ 30 }, (int){ int }) } 1396 + max: (int){ |(*(int){ 40 }, (int){ int }) } 1397 + } 1398 + }) } 1399 + } 1400 + spec: (#struct){ |(*(#struct){ 1401 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1402 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1403 + minBar?: (null){ null } 1404 + maxBar?: (null){ null } 1405 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1406 + fuga?: (null){ null } 1407 + }, (#struct){ 1408 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1409 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1410 + minBar?: (null){ null } 1411 + maxBar?: (null){ null } 1412 + hoge?: (null){ null } 1413 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1414 + }) } 1415 + } 1416 + } 1417 + _#Spec: (#struct){ |(*(#struct){ 1418 + foo: (#struct){ 1419 + min: (int){ |(*(int){ 10 }, (int){ int }) } 1420 + max: (int){ |(*(int){ 20 }, (int){ int }) } 1421 + } 1422 + }, (#struct){ 1423 + bar: (#struct){ 1424 + min: (int){ |(*(int){ 30 }, (int){ int }) } 1425 + max: (int){ |(*(int){ 40 }, (int){ int }) } 1426 + } 1427 + }) } 1428 + _#SpecFoo: (#struct){ 1429 + foo: (#struct){ 1430 + min: (int){ |(*(int){ 10 }, (int){ int }) } 1431 + max: (int){ |(*(int){ 20 }, (int){ int }) } 1432 + } 1433 + } 1434 + _#SpecBar: (#struct){ 1435 + bar: (#struct){ 1436 + min: (int){ |(*(int){ 30 }, (int){ int }) } 1437 + max: (int){ |(*(int){ 40 }, (int){ int }) } 1438 + } 1439 + } 1440 + _Thing: (#struct){ 1441 + _X: (_){ _ } 1442 + spec: (#struct){ |(*(#struct){ 1443 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1444 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1445 + minBar?: (null){ null } 1446 + maxBar?: (null){ null } 1447 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1448 + fuga?: (null){ null } 1449 + }, *(#struct){ 1450 + minFoo?: (null){ null } 1451 + maxFoo?: (null){ null } 1452 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1453 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1454 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1455 + fuga?: (null){ null } 1456 + }, (#struct){ 1457 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1458 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1459 + minBar?: (null){ null } 1460 + maxBar?: (null){ null } 1461 + hoge?: (null){ null } 1462 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1463 + }, (#struct){ 1464 + minFoo?: (null){ null } 1465 + maxFoo?: (null){ null } 1466 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1467 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1468 + hoge?: (null){ null } 1469 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1470 + }) } 1471 + } 1472 + #Constrained: (#struct){ 1473 + spec: (#struct){ |(*(#struct){ 1474 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1475 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1476 + minBar?: (null){ null } 1477 + maxBar?: (null){ null } 1478 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1479 + fuga?: (null){ null } 1480 + }, *(#struct){ 1481 + minFoo?: (null){ null } 1482 + maxFoo?: (null){ null } 1483 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1484 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1485 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1486 + fuga?: (null){ null } 1487 + }, (#struct){ 1488 + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } 1489 + maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } 1490 + minBar?: (null){ null } 1491 + maxBar?: (null){ null } 1492 + hoge?: (null){ null } 1493 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1494 + }, (#struct){ 1495 + minFoo?: (null){ null } 1496 + maxFoo?: (null){ null } 1497 + minBar: (int){ |(*(int){ 30 }, (int){ int }) } 1498 + maxBar: (int){ |(*(int){ 40 }, (int){ int }) } 1499 + hoge?: (null){ null } 1500 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1501 + }) } 1502 + } 1503 + #Base: (#struct){ 1504 + spec: (#struct){ 1505 + minFoo?: ((null|int)){ |((null){ null }, (int){ int }) } 1506 + maxFoo?: ((null|int)){ |((null){ null }, (int){ int }) } 1507 + minBar?: ((null|int)){ |((null){ null }, (int){ int }) } 1508 + maxBar?: ((null|int)){ |((null){ null }, (int){ int }) } 1509 + hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1510 + fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) } 1511 + } 1512 + } 1513 + } 1514 + } 1515 + issue2246: (struct){ 1516 + simplified: (struct){ 1517 + #FormFoo: (#struct){ 1518 + fooID: (string){ string } 1519 + } 1520 + #FormBar: (#struct){ 1521 + barID: (string){ string } 1522 + } 1523 + #Form: (#struct){ |((#struct){ 1524 + fooID: (string){ string } 1525 + }, (#struct){ 1526 + barID: (string){ string } 1527 + }) } 1528 + data: (struct){ 1529 + fooID: (string){ "123" } 1530 + } 1531 + out1: (#struct){ 1532 + fooID: (string){ "123" } 1533 + } 1534 + out2: (#struct){ 1535 + fooID: (string){ "123" } 1536 + } 1537 + } 1538 + full: (struct){ 1539 + data: (struct){ 1540 + forms: (#list){ 1541 + 0: (struct){ 1542 + fooID: (string){ "00-0000001" } 1543 + } 1544 + } 1545 + } 1546 + form1040: (#list){ 1547 + 0: (int){ 3 } 1548 + } 1549 + #K1: (#struct){ 1550 + #_base: (#struct){ 1551 + common: (int){ 3 } 1552 + } 1553 + #FormFoo: (#struct){ 1554 + fooID: (string){ string } 1555 + common: (int){ 3 } 1556 + } 1557 + #FormBar: (#struct){ 1558 + barID: (string){ string } 1559 + common: (int){ 3 } 1560 + } 1561 + #Form: (#struct){ |((#struct){ 1562 + fooID: (string){ string } 1563 + common: (int){ 3 } 1564 + }, (#struct){ 1565 + barID: (string){ string } 1566 + common: (int){ 3 } 1567 + }) } 1568 + } 1569 + #Input: (#struct){ 1570 + forms: (list){ 1571 + } 1572 + } 1573 + #summarizeReturn: (#struct){ 1574 + in: ~(issue2246.full.#Input) 1575 + out: (#list){ 1576 + } 1577 + } 1578 + #compute: (#struct){ 1579 + in: ~(issue2246.full.#Input) 1580 + out: (#list){ 1581 + } 1582 + } 1583 + } 1584 + } 1585 + issue2263: (struct){ 1586 + simplified: (struct){ 1587 + metrics: (#struct){ 1588 + id: (string){ "foo" } 1589 + avg: (int){ 60 } 1590 + } 1591 + #Metric: (#struct){ |((#struct){ 1592 + id: (string){ string } 1593 + avg: (number){ number } 1594 + }, (#struct){ 1595 + id: (string){ string } 1596 + }, (#struct){ 1597 + avg: (number){ number } 1598 + }, (#struct){ 1599 + }) } 1600 + #IDSource: (#struct){ 1601 + id: (string){ string } 1602 + } 1603 + #TargetAverage: (#struct){ 1604 + avg: (number){ number } 1605 + } 1606 + } 1607 + full: (struct){ 1608 + metrics: (#list){ 1609 + 0: (#struct){ 1610 + id: (string){ "foo" } 1611 + avg: (int){ 60 } 1612 + } 1613 + 1: (#struct){ 1614 + id: (string){ "bar" } 1615 + value: (int){ 80 } 1616 + } 1617 + 2: (#struct){ 1618 + uri: (string){ "baz" } 1619 + avg: (int){ 70 } 1620 + } 1621 + 3: (#struct){ 1622 + uri: (string){ "qux" } 1623 + value: (int){ 90 } 1624 + } 1625 + } 1626 + #Metric: (#struct){ |((#struct){ 1627 + id: (string){ string } 1628 + avg: (number){ number } 1629 + }, (#struct){ 1630 + id: (string){ string } 1631 + value: (number){ number } 1632 + }, (#struct){ 1633 + uri: (string){ string } 1634 + avg: (number){ number } 1635 + }, (#struct){ 1636 + uri: (string){ string } 1637 + value: (number){ number } 1638 + }) } 1639 + #Source: (#struct){ |((#struct){ 1640 + id: (string){ string } 1641 + }, (#struct){ 1642 + uri: (string){ string } 1643 + }) } 1644 + #Target: (#struct){ |((#struct){ 1645 + avg: (number){ number } 1646 + }, (#struct){ 1647 + value: (number){ number } 1648 + }) } 1649 + #IDSource: (#struct){ 1650 + id: (string){ string } 1651 + } 1652 + #URISource: (#struct){ 1653 + uri: (string){ string } 1654 + } 1655 + #TargetAverage: (#struct){ 1656 + avg: (number){ number } 1657 + } 1658 + #TargetValue: (#struct){ 1659 + value: (number){ number } 1660 + } 1661 + } 1662 + } 1663 + issue2685: (struct){ 1664 + #Foo: (#struct){ |(*(#struct){ 1665 + opt: (int){ int } 1666 + }, (#struct){ 1667 + bar: (int){ int } 1668 + opt?: (int){ int } 1669 + }) } 1670 + foo: (#struct){ 1671 + bar: (int){ 0 } 1672 + opt?: (int){ int } 1673 + } 1674 + } 1675 + issue3149: (struct){ 1676 + #valid: (#struct){ 1677 + name!: (string){ |((string){ &(=~"^Foo", =~"Foo$") }, (string){ "an exception" }) } 1678 + } 1679 + list: (#list){ 1680 + 0: (#struct){ 1681 + name: (string){ "FooBarFoo" } 1682 + } 1683 + 1: (#struct){ 1684 + name: (string){ "FooBazFoo" } 1685 + } 1686 + 2: (#struct){ 1687 + name: (string){ "FooQuuxFoo" } 1688 + } 1689 + 3: (#struct){ 1690 + name: (string){ "an exception" } 1691 + } 1692 + } 1693 + } 1694 + issue3528: (struct){ 1695 + original: (struct){ 1696 + workflows: (#list){ 1697 + 0: (#struct){ 1698 + container: (#struct){ 1699 + } 1700 + #container: ((string|struct)){ |((string){ string }, (#struct){ 1701 + volumes?: (list){ 1702 + } 1703 + }) } 1704 + } 1705 + } 1706 + test: (#struct){ 1707 + container: (#struct){ 1708 + } 1709 + #container: ((string|struct)){ |((string){ string }, (#struct){ 1710 + volumes?: (list){ 1711 + } 1712 + }) } 1713 + } 1714 + #Workflow: (#struct){ 1715 + container: (#struct){ 1716 + } 1717 + #container: ((string|struct)){ |((string){ string }, (#struct){ 1718 + volumes?: (list){ 1719 + } 1720 + }) } 1721 + } 1722 + } 1723 + reduced: (struct){ 1724 + a: (#struct){ 1725 + A: (#struct){ 1726 + } 1727 + #a: ((int|struct)){ |((int){ 2 }, (#struct){ 1728 + v: (int){ 1 } 1729 + }) } 1730 + } 1731 + #A: (#struct){ 1732 + A: (#struct){ 1733 + } 1734 + #a: ((int|struct)){ |((int){ 2 }, (#struct){ 1735 + v: (int){ 1 } 1736 + }) } 1737 + } 1738 + } 1739 + counter: (struct){ 1740 + } 1741 + nested: (struct){ 1742 + t1: ((int|struct)){ |((struct){ 1743 + v: (int){ 1 } 1744 + }, (int){ 2 }, (int){ 3 }) } 1745 + t2: ((int|struct)){ |((struct){ 1746 + v: (int){ 1 } 1747 + }, (int){ 2 }) } 1748 + } 1749 + } 1750 + issue3784: (struct){ 1751 + reduced: (struct){ 1752 + #Schema: (#struct){ 1753 + a: (#struct){ |((#struct){ 1754 + kind: (string){ "A" } 1755 + b: (#struct){ 1756 + c?: (string){ string } 1757 + } 1758 + }, (#struct){ 1759 + kind: (string){ "B" } 1760 + }) } 1761 + } 1762 + out: (#struct){ 1763 + a: (#struct){ 1764 + kind: (string){ "A" } 1765 + b: (#struct){ 1766 + c: (string){ "x" } 1767 + } 1768 + } 1769 + } 1770 + } 1771 + full: (struct){ 1772 + #Schema: (#struct){ 1773 + pages?: (#struct){ |((#struct){ 1774 + build_type!: (string){ "legacy" } 1775 + source!: (#struct){ 1776 + branch!: (string){ string } 1777 + path?: (string){ string } 1778 + } 1779 + cname?: (string){ string } 1780 + }, (#struct){ 1781 + build_type!: (string){ "workflow" } 1782 + source?: (_|_){ 1783 + // [eval] issue3784.full.#Schema.pages.source: field not allowed: 1784 + // ./issue3784.cue:20:4 1785 + branch?: (string){ string } 1786 + path?: (string){ string } 1787 + } 1788 + cname?: (string){ string } 1789 + }) } 1790 + } 1791 + out: (#struct){ 1792 + pages: (#struct){ 1793 + cname: (string){ "foo.com" } 1794 + build_type: (string){ "legacy" } 1795 + source: (#struct){ 1796 + branch: (string){ "main" } 1797 + path: (string){ "/" } 1798 + } 1799 + } 1800 + } 1801 + } 1802 + variant1: (struct){ 1803 + #Schema: (#struct){ 1804 + pages: (#struct){ 1805 + build_type!: (string){ "legacy" } 1806 + source: (#struct){ 1807 + branch!: (string){ string } 1808 + path?: (string){ string } 1809 + } 1810 + cname?: (string){ string } 1811 + } 1812 + } 1813 + } 1814 + variant2: (struct){ 1815 + #Schema: (#struct){ |((#struct){ 1816 + build_type!: (string){ "legacy" } 1817 + source!: (#struct){ 1818 + branch!: (_){ _ } 1819 + } 1820 + }, (#struct){ 1821 + build_type!: (string){ "workflow" } 1822 + cname?: (_){ _ } 1823 + }) } 1824 + a: (#struct){ 1825 + build_type!: (string){ "legacy" } 1826 + source: (#struct){ 1827 + branch!: (string){ string } 1828 + path?: (_|_){ 1829 + // [eval] issue3784.variant2.a.source.path: field not allowed: 1830 + // ./issue3784.cue:83:4 1831 + } 1832 + } 1833 + cname?: (_|_){ 1834 + // [eval] issue3784.variant2.a.cname: field not allowed: 1835 + // ./issue3784.cue:85:3 1836 + } 1837 + } 1838 + } 1839 + } 1840 + issue3958: (struct){ 1841 + t1: (struct){ 1842 + #schema: (int){ |((int){ int }, (int){ 3 }, (int){ 1 }) } 1843 + test1: (int){ |((int){ int }, (int){ 3 }, (int){ 1 }, (int){ 2 }) } 1844 + test2: (int){ |((int){ int }, (int){ 3 }, (int){ 1 }, (int){ 4 }) } 1845 + } 1846 + t2: (struct){ 1847 + a: (int){ |((int){ int }, (int){ 8 }, (int){ 3 }, (int){ 1 }, (int){ 4 }) } 1848 + b: (int){ |((int){ int }, (int){ 3 }, (int){ 1 }, (int){ 4 }) } 1849 + } 1850 + } 1851 + issue770: (struct){ 1852 + #A: (#struct){ 1853 + v: (string){ |((string){ "a" }, (string){ "b" }, (string){ "c" }) } 1854 + } 1855 + h: (struct){ 1856 + a: (#struct){ 1857 + v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } 1858 + } 1859 + b: (#struct){ 1860 + v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } 1861 + } 1862 + boo: (#struct){ 1863 + v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } 1864 + } 1865 + c: (#struct){ 1866 + v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } 1867 + } 1868 + coo: (#struct){ 1869 + v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } 1870 + } 1871 + } 1872 + } 1873 + } 1874 + -- diff/-out/evalalpha<==>+out/eval -- 1875 + diff old new 1876 + --- old 1877 + +++ new 1878 + @@ -917,6 +917,18 @@ 1879 + } 1880 + } 1881 + } 1882 + + issue2685: (struct){ 1883 + + #Foo: (#struct){ |(*(#struct){ 1884 + + opt: (int){ int } 1885 + + }, (#struct){ 1886 + + bar: (int){ int } 1887 + + opt?: (int){ int } 1888 + + }) } 1889 + + foo: (#struct){ 1890 + + bar: (int){ 0 } 1891 + + opt?: (int){ int } 1892 + + } 1893 + + } 1894 + issue3149: (struct){ 1895 + #valid: (#struct){ 1896 + name!: (string){ |((string){ &(=~"^Foo", =~"Foo$") }, (string){ "an exception" }) } 727 1897 -- out/eval -- 728 1898 (struct){ 729 1899 disambiguateClosed: (struct){ ··· 2878 4048 #TargetValue: { 2879 4049 value: number 2880 4050 } 4051 + } 4052 + } 4053 + } 4054 + --- issue2685.cue 4055 + { 4056 + issue2685: { 4057 + #Foo: ({ 4058 + bar: int 4059 + opt?: int 4060 + }|*{ 4061 + opt: int 4062 + }) 4063 + foo: 〈0;#Foo〉 4064 + foo: { 4065 + bar: 0 4066 + } 4067 + { 4068 + foo: 〈1;#Foo〉 2881 4069 } 2882 4070 } 2883 4071 }