@@ -386,23 +386,43 @@ issue3903: full: {
386
386
]
387
387
}
388
388
}
389
+ -- issue3941.cue --
390
+ issue3941: full: {
391
+ #Metadata: name: string
392
+ #Resource: metadata: #Metadata
393
+
394
+ out: {
395
+ _metadata: name: "foo"
396
+ resource: [string]: [string]: #Resource
397
+
398
+ _names: [_metadata.name]
399
+
400
+ for name in _names {
401
+ resource: level1: (name): {
402
+ metadata: _metadata
403
+ }
404
+ }
405
+ }
406
+ }
389
407
-- out/evalalpha/stats --
390
- Leaks: 978
408
+ Leaks: 996
391
409
Freed: 0
392
410
Reused: 0
393
- Allocs: 978
411
+ Allocs: 996
394
412
Retain: 0
395
413
396
- Unifications: 607
397
- Conjuncts: 1677
414
+ Unifications: 625
415
+ Conjuncts: 1705
398
416
Disjuncts: 202
399
417
400
418
CloseIDElems: 10137
401
- NumCloseIDs: 846
419
+ NumCloseIDs: 850
402
420
-- out/evalalpha --
403
421
Errors:
404
422
selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced:
405
423
./in.cue:122:14
424
+ issue3941.full.out.resource.level1.foo.metadata: adding field name not allowed as field set was already referenced:
425
+ ./issue3941.cue:3:23
406
426
407
427
Result:
408
428
(_|_){
@@ -1064,12 +1084,46 @@ Result:
1064
1084
}
1065
1085
}
1066
1086
}
1087
+ issue3941: (_|_){
1088
+ // [eval]
1089
+ full: (_|_){
1090
+ // [eval]
1091
+ #Metadata: (#struct){
1092
+ name: (string){ string }
1093
+ }
1094
+ #Resource: (#struct){
1095
+ metadata: ~(issue3941.full.#Metadata)
1096
+ }
1097
+ out: (_|_){
1098
+ // [eval]
1099
+ _metadata: (struct){
1100
+ name: (string){ "foo" }
1101
+ }
1102
+ resource: (_|_){
1103
+ // [eval]
1104
+ level1: (_|_){
1105
+ // [eval]
1106
+ foo: (_|_){
1107
+ // [eval]
1108
+ metadata: (_|_){
1109
+ // [eval] issue3941.full.out.resource.level1.foo.metadata: adding field name not allowed as field set was already referenced:
1110
+ // ./issue3941.cue:3:23
1111
+ }
1112
+ }
1113
+ }
1114
+ }
1115
+ _names: (#list){
1116
+ 0: (string){ "foo" }
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1067
1121
}
1068
1122
-- diff/-out/evalalpha<==>+out/eval --
1069
1123
diff old new
1070
1124
--- old
1071
1125
+++ new
1072
- @@ -1,13 +1,6 @@
1126
+ @@ -1,13 +1,8 @@
1073
1127
Errors:
1074
1128
-selfReferential.insertionError.A: field foo3 not allowed by earlier comprehension or reference cycle
1075
1129
-issue2310.original.#sub.#_1.#_1.#_1: structural cycle:
@@ -1082,10 +1136,12 @@ diff old new
1082
1136
- ./in.cue:347:21
1083
1137
+selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced:
1084
1138
+ ./in.cue:122:14
1139
+ +issue3941.full.out.resource.level1.foo.metadata: adding field name not allowed as field set was already referenced:
1140
+ + ./issue3941.cue:3:23
1085
1141
1086
1142
Result:
1087
1143
(_|_){
1088
- @@ -27,7 +20 ,9 @@
1144
+ @@ -27,7 +22 ,9 @@
1089
1145
B: (struct){
1090
1146
a: (struct){
1091
1147
parent: (string){ "" }
@@ -1096,7 +1152,7 @@ diff old new
1096
1152
}
1097
1153
}
1098
1154
}
1099
- @@ -60,17 +55 ,12 @@
1155
+ @@ -60,17 +57 ,12 @@
1100
1156
}
1101
1157
}
1102
1158
_e: (#struct){
@@ -1120,7 +1176,7 @@ diff old new
1120
1176
}
1121
1177
}
1122
1178
e: (#struct){
1123
- @@ -84,12 +74 ,7 @@
1179
+ @@ -84,12 +76 ,7 @@
1124
1180
}
1125
1181
f2: (#struct){
1126
1182
a: (#struct){
@@ -1134,7 +1190,7 @@ diff old new
1134
1190
}
1135
1191
}
1136
1192
}
1137
- @@ -135,9 +120 ,9 @@
1193
+ @@ -135,9 +122 ,9 @@
1138
1194
insertionError: (_|_){
1139
1195
// [eval]
1140
1196
A: (_|_){
@@ -1146,7 +1202,7 @@ diff old new
1146
1202
}
1147
1203
}
1148
1204
acrossOr: (struct){
1149
- @@ -405,10 +390 ,8 @@
1205
+ @@ -405,10 +392 ,8 @@
1150
1206
issue2367: (struct){
1151
1207
a: (_){ _ }
1152
1208
}
@@ -1159,7 +1215,7 @@ diff old new
1159
1215
#s: (_|_){
1160
1216
// [incomplete] issue2310.original.#s: error in call to strings.Replace: non-concrete value string:
1161
1217
// ./in.cue:318:46
1162
- @@ -418,14 +401 ,128 @@
1218
+ @@ -418,14 +403 ,128 @@
1163
1219
#_3: (string){ string }
1164
1220
}
1165
1221
#sub: (_|_){
@@ -1296,7 +1352,7 @@ diff old new
1296
1352
}
1297
1353
#subs: (#list){
1298
1354
0: (_|_){
1299
- @@ -432,33 +529 ,62 @@
1355
+ @@ -432,33 +531 ,62 @@
1300
1356
// [incomplete] issue2310.original.#subs.0: error in call to strings.Replace: non-concrete value string:
1301
1357
// ./in.cue:318:46
1302
1358
// ./in.cue:318:12
@@ -1372,7 +1428,7 @@ diff old new
1372
1428
}
1373
1429
#s: (_|_){
1374
1430
// [incomplete] issue2310.reduced.#s: non-concrete value string in operand to +:
1375
- @@ -496,9 +622 ,6 @@
1431
+ @@ -496,9 +624 ,6 @@
1376
1432
}
1377
1433
full: (struct){
1378
1434
s1: (#struct){
@@ -1382,7 +1438,7 @@ diff old new
1382
1438
_deps: (#list){
1383
1439
0: (#struct){
1384
1440
_local: (#list){
1385
- @@ -511,6 +634 ,9 @@
1441
+ @@ -511,6 +636 ,9 @@
1386
1442
}
1387
1443
}
1388
1444
}
@@ -1392,42 +1448,85 @@ diff old new
1392
1448
objs: (#list){
1393
1449
0: (string){ "s1 local" }
1394
1450
1: (string){ "s2 local" }
1451
+ @@ -536,25 +664,30 @@
1452
+ }
1453
+ }
1454
+ }
1455
+ - issue3941: (struct){
1456
+ - full: (struct){
1457
+ + issue3941: (_|_){
1458
+ + // [eval]
1459
+ + full: (_|_){
1460
+ + // [eval]
1461
+ #Metadata: (#struct){
1462
+ name: (string){ string }
1463
+ }
1464
+ #Resource: (#struct){
1465
+ - metadata: (#struct){
1466
+ - name: (string){ string }
1467
+ - }
1468
+ - }
1469
+ - out: (struct){
1470
+ + metadata: ~(issue3941.full.#Metadata)
1471
+ + }
1472
+ + out: (_|_){
1473
+ + // [eval]
1474
+ _metadata: (struct){
1475
+ name: (string){ "foo" }
1476
+ }
1477
+ - resource: (struct){
1478
+ - level1: (struct){
1479
+ - foo: (#struct){
1480
+ - metadata: (#struct){
1481
+ - name: (string){ "foo" }
1482
+ + resource: (_|_){
1483
+ + // [eval]
1484
+ + level1: (_|_){
1485
+ + // [eval]
1486
+ + foo: (_|_){
1487
+ + // [eval]
1488
+ + metadata: (_|_){
1489
+ + // [eval] issue3941.full.out.resource.level1.foo.metadata: adding field name not allowed as field set was already referenced:
1490
+ + // ./issue3941.cue:3:23
1491
+ }
1492
+ }
1493
+ }
1395
1494
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
1396
1495
diff old new
1397
1496
--- old
1398
1497
+++ new
1399
1498
@@ -1,9 +1,12 @@
1400
- -Leaks: 74
1401
- -Freed: 1367
1402
- -Reused: 1341
1499
+ -Leaks: 75
1500
+ -Freed: 1383
1501
+ -Reused: 1358
1403
1502
-Allocs: 100
1404
- -Retain: 478
1503
+ -Retain: 479
1405
1504
-
1406
- -Unifications: 953
1407
- -Conjuncts: 2946
1408
- -Disjuncts: 1686
1409
- +Leaks: 978
1505
+ -Unifications: 970
1506
+ -Conjuncts: 2973
1507
+ -Disjuncts: 1704
1508
+ +Leaks: 996
1410
1509
+Freed: 0
1411
1510
+Reused: 0
1412
- +Allocs: 978
1511
+ +Allocs: 996
1413
1512
+Retain: 0
1414
1513
+
1415
- +Unifications: 607
1416
- +Conjuncts: 1677
1514
+ +Unifications: 625
1515
+ +Conjuncts: 1705
1417
1516
+Disjuncts: 202
1418
1517
+
1419
1518
+CloseIDElems: 10137
1420
- +NumCloseIDs: 846
1519
+ +NumCloseIDs: 850
1421
1520
-- out/eval/stats --
1422
- Leaks: 74
1423
- Freed: 1367
1424
- Reused: 1341
1521
+ Leaks: 75
1522
+ Freed: 1383
1523
+ Reused: 1358
1425
1524
Allocs: 100
1426
- Retain: 478
1525
+ Retain: 479
1427
1526
1428
- Unifications: 953
1429
- Conjuncts: 2946
1430
- Disjuncts: 1686
1527
+ Unifications: 970
1528
+ Conjuncts: 2973
1529
+ Disjuncts: 1704
1431
1530
-- diff/explanation --
1432
1531
B.a.children: now correctly marked as incomplete
1433
1532
-- out/eval --
@@ -1969,6 +2068,35 @@ Result:
1969
2068
}
1970
2069
}
1971
2070
}
2071
+ issue3941: (struct){
2072
+ full: (struct){
2073
+ #Metadata: (#struct){
2074
+ name: (string){ string }
2075
+ }
2076
+ #Resource: (#struct){
2077
+ metadata: (#struct){
2078
+ name: (string){ string }
2079
+ }
2080
+ }
2081
+ out: (struct){
2082
+ _metadata: (struct){
2083
+ name: (string){ "foo" }
2084
+ }
2085
+ resource: (struct){
2086
+ level1: (struct){
2087
+ foo: (#struct){
2088
+ metadata: (#struct){
2089
+ name: (string){ "foo" }
2090
+ }
2091
+ }
2092
+ }
2093
+ }
2094
+ _names: (#list){
2095
+ 0: (string){ "foo" }
2096
+ }
2097
+ }
2098
+ }
2099
+ }
1972
2100
}
1973
2101
-- out/compile --
1974
2102
--- in.cue
@@ -2585,3 +2713,38 @@ Result:
2585
2713
}
2586
2714
}
2587
2715
}
2716
+ --- issue3941.cue
2717
+ {
2718
+ issue3941: {
2719
+ full: {
2720
+ #Metadata: {
2721
+ name: string
2722
+ }
2723
+ #Resource: {
2724
+ metadata: 〈1;#Metadata〉
2725
+ }
2726
+ out: {
2727
+ _metadata: {
2728
+ name: "foo"
2729
+ }
2730
+ resource: {
2731
+ [string]: {
2732
+ [string]: 〈3;#Resource〉
2733
+ }
2734
+ }
2735
+ _names: [
2736
+ 〈1;_metadata〉.name,
2737
+ ]
2738
+ for _, name in 〈0;_names〉 {
2739
+ resource: {
2740
+ level1: {
2741
+ 〈3;name〉: {
2742
+ metadata: 〈5;_metadata〉
2743
+ }
2744
+ }
2745
+ }
2746
+ }
2747
+ }
2748
+ }
2749
+ }
2750
+ }
0 commit comments