this repo has no description
0
fork

Configure Feed

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

internal/core/adt: do not finalize let

Finalizing lets results in unmatched counters, among
other issues. The change results in worse error messages,
but we will deal with that later.

issue990 seems now to have been solved, but we know
this is an order of evaluation issue and that the
error will likely return. We therefore do not remove
the todo from this file.

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

+221 -730
+4 -4
cue/testdata/benchmarks/issue2176.txtar
··· 61 61 -- out/eval/stats -- 62 62 Leaks: 90 63 63 Freed: 4079 64 - Reused: 4074 65 - Allocs: 95 66 - Retain: 1359 64 + Reused: 4072 65 + Allocs: 97 66 + Retain: 1364 67 67 68 68 Unifications: 4161 69 69 Conjuncts: 9489 70 - Disjuncts: 4804 70 + Disjuncts: 4809 71 71 -- out/evalalpha -- 72 72 (struct){ 73 73 #Datastream: (#struct){
+13 -13
cue/testdata/compile/scope.txtar
··· 82 82 Freed: 48 83 83 Reused: 45 84 84 Allocs: 5 85 - Retain: 8 85 + Retain: 7 86 86 87 87 Unifications: 50 88 88 Conjuncts: 102 89 89 Disjuncts: 54 90 90 -- out/evalalpha -- 91 91 Errors: 92 - _schema_1: structural cycle: 93 - ./in.cue:32:8 92 + _schema_1: structural cycle 94 93 95 94 Result: 96 95 (_|_){ ··· 120 119 schema: (_|_){ 121 120 // [structural cycle] 122 121 next: (_|_){ 123 - // [structural cycle] _schema_1: structural cycle: 124 - // ./in.cue:32:8 122 + // [structural cycle] _schema_1: structural cycle 125 123 } 126 124 } 127 125 let _schema_1#2 = (_|_){ 128 - // [structural cycle] _schema_1: structural cycle: 129 - // ./in.cue:32:8 126 + // [structural cycle] _schema_1: structural cycle 130 127 } 131 128 } 132 129 -- diff/-out/evalalpha<==>+out/eval -- 133 130 diff old new 134 131 --- old 135 132 +++ new 136 - @@ -1,5 +1,6 @@ 133 + @@ -1,5 +1,5 @@ 137 134 Errors: 138 135 -schema.next: structural cycle 139 - +_schema_1: structural cycle: 140 - + ./in.cue:32:8 136 + +_schema_1: structural cycle 141 137 142 138 Result: 143 139 (_|_){ 144 - @@ -29,7 +30,8 @@ 140 + @@ -29,11 +29,10 @@ 145 141 schema: (_|_){ 146 142 // [structural cycle] 147 143 next: (_|_){ 148 144 - // [structural cycle] schema.next: structural cycle 149 - + // [structural cycle] _schema_1: structural cycle: 150 - + // ./in.cue:32:8 145 + + // [structural cycle] _schema_1: structural cycle 151 146 } 152 147 } 153 148 let _schema_1#2 = (_|_){ 149 + - // [structural cycle] _schema_1: structural cycle: 150 + - // ./in.cue:32:8 151 + + // [structural cycle] _schema_1: structural cycle 152 + } 153 + } 154 154 -- diff/todo/p3 -- 155 155 Structural cycle reported in different location. Seems fine, as 156 156 ultimately we need to print the paths of the cycle anyway.
+6 -6
cue/testdata/comprehensions/checkdefined.txtar
··· 82 82 83 83 -- out/eval/stats -- 84 84 Leaks: 11 85 - Freed: 89 86 - Reused: 85 85 + Freed: 87 86 + Reused: 83 87 87 Allocs: 15 88 - Retain: 26 88 + Retain: 20 89 89 90 - Unifications: 100 91 - Conjuncts: 134 92 - Disjuncts: 105 90 + Unifications: 98 91 + Conjuncts: 131 92 + Disjuncts: 102 93 93 -- out/eval -- 94 94 (struct){ 95 95 xc: (#struct){
+4 -4
cue/testdata/comprehensions/issue2481.txtar
··· 73 73 -- out/eval/stats -- 74 74 Leaks: 3 75 75 Freed: 23 76 - Reused: 17 77 - Allocs: 9 78 - Retain: 58 76 + Reused: 16 77 + Allocs: 10 78 + Retain: 61 79 79 80 80 Unifications: 26 81 81 Conjuncts: 50 82 - Disjuncts: 56 82 + Disjuncts: 59 83 83 -- out/eval -- 84 84 Errors: 85 85 out: cannot combine regular field "val" with "b":
+1 -1
cue/testdata/comprehensions/pushdown.txtar
··· 1706 1706 Freed: 405 1707 1707 Reused: 399 1708 1708 Allocs: 21 1709 - Retain: 101 1709 + Retain: 102 1710 1710 1711 1711 Unifications: 406 1712 1712 Conjuncts: 652
+1 -1
cue/testdata/cycle/evaluate.txtar
··· 118 118 Freed: 92 119 119 Reused: 89 120 120 Allocs: 62 121 - Retain: 129 121 + Retain: 127 122 122 123 123 Unifications: 139 124 124 Conjuncts: 274
+17 -541
cue/testdata/cycle/issue990.txtar
··· 77 77 // Test 78 78 79 79 out: #sub & {#p: _test.s1} 80 - -- out/evalalpha -- 81 - Errors: 82 - out.subs.subs: structural cycle: 83 - ./in.cue:34:17 84 - 85 - Result: 86 - (_|_){ 87 - // [structural cycle] 88 - #AC: (#struct){ 89 - k: (string){ "simple" } 90 - d: (#struct){ 91 - n: (string){ string } 92 - } 93 - } 94 - #AS: (#struct){ 95 - k: (string){ "complex" } 96 - d: (#struct){ 97 - n: (string){ string } 98 - r: (#struct){ 99 - } 100 - } 101 - } 102 - #R: (#struct){ 103 - a: (#struct){ 104 - k: (string){ "simple" } 105 - d: (#struct){ 106 - n: (string){ string } 107 - } 108 - } 109 - } 110 - #S: (#struct){ 111 - n: (string){ string } 112 - r: (#struct){ 113 - } 114 - } 115 - #C: (#struct){ 116 - n: (string){ string } 117 - } 118 - #sub: (#struct){ 119 - #p: (#struct){ 120 - k: (string){ "complex" } 121 - d: (#struct){ 122 - n: (string){ string } 123 - r: (#struct){ 124 - } 125 - } 126 - } 127 - dict: (#struct){ 128 - } 129 - let subs#1multi = &[&[&[&[(〈3;#sub〉 & { 130 - #p: 〈2;rd〉.a 131 - })]]]] 132 - } 133 - _test: (struct){ 134 - c1: (#struct){ 135 - d: (#struct){ 136 - n: (string){ "c1" } 137 - } 138 - k: (string){ "simple" } 139 - } 140 - s3: (#struct){ 141 - d: (#struct){ 142 - n: (string){ "s3" } 143 - r: (#struct){ 144 - r1: (#struct){ 145 - a: (#struct){ 146 - d: (#struct){ 147 - n: (string){ "c1" } 148 - } 149 - k: (string){ "simple" } 150 - } 151 - } 152 - } 153 - } 154 - k: (string){ "complex" } 155 - } 156 - s2: (#struct){ 157 - d: (#struct){ 158 - n: (string){ "s2" } 159 - r: (#struct){ 160 - r1: (#struct){ 161 - a: (#struct){ 162 - d: (#struct){ 163 - n: (string){ "c1" } 164 - } 165 - k: (string){ "simple" } 166 - } 167 - } 168 - r2: (#struct){ 169 - a: (#struct){ 170 - d: (#struct){ 171 - n: (string){ "s3" } 172 - r: (#struct){ 173 - r1: (#struct){ 174 - a: (#struct){ 175 - d: (#struct){ 176 - n: (string){ "c1" } 177 - } 178 - k: (string){ "simple" } 179 - } 180 - } 181 - } 182 - } 183 - k: (string){ "complex" } 184 - } 185 - } 186 - } 187 - } 188 - k: (string){ "complex" } 189 - } 190 - s1: (#struct){ 191 - d: (#struct){ 192 - n: (string){ "s1" } 193 - r: (#struct){ 194 - r1: (#struct){ 195 - a: (#struct){ 196 - d: (#struct){ 197 - n: (string){ "c1" } 198 - } 199 - k: (string){ "simple" } 200 - } 201 - } 202 - r2: (#struct){ 203 - a: (#struct){ 204 - d: (#struct){ 205 - n: (string){ "s2" } 206 - r: (#struct){ 207 - r1: (#struct){ 208 - a: (#struct){ 209 - d: (#struct){ 210 - n: (string){ "c1" } 211 - } 212 - k: (string){ "simple" } 213 - } 214 - } 215 - r2: (#struct){ 216 - a: (#struct){ 217 - d: (#struct){ 218 - n: (string){ "s3" } 219 - r: (#struct){ 220 - r1: (#struct){ 221 - a: (#struct){ 222 - d: (#struct){ 223 - n: (string){ "c1" } 224 - } 225 - k: (string){ "simple" } 226 - } 227 - } 228 - } 229 - } 230 - k: (string){ "complex" } 231 - } 232 - } 233 - } 234 - } 235 - k: (string){ "complex" } 236 - } 237 - } 238 - } 239 - } 240 - k: (string){ "complex" } 241 - } 242 - } 243 - out: (_|_){ 244 - // [structural cycle] out.subs.subs: structural cycle: 245 - // ./in.cue:34:17 246 - } 247 - } 80 + -- diff/todo/p0 -- 81 + out.subs.subs.#p: invalid structural cycle 82 + This seems to be the result of incorrect handling of disjunctions. 83 + -- diff/todo/p3 -- 84 + Reordering 248 85 -- diff/todo/p3 -- 249 86 Reordering 250 87 -- out/evalalpha/stats -- ··· 257 94 Unifications: 239 258 95 Conjuncts: 8656 259 96 Disjuncts: 522 260 - -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 261 - diff old new 262 - --- old 263 - +++ new 264 - @@ -1,9 +1,9 @@ 265 - -Leaks: 6 266 - -Freed: 3232 267 - -Reused: 3213 268 - -Allocs: 25 269 - -Retain: 26 270 - +Leaks: 2604 271 - +Freed: 263 272 - +Reused: 263 273 - +Allocs: 2604 274 - +Retain: 0 275 - 276 - -Unifications: 2588 277 - -Conjuncts: 12056 278 - -Disjuncts: 3258 279 - +Unifications: 239 280 - +Conjuncts: 8656 281 - +Disjuncts: 522 282 - -- diff/-out/evalalpha<==>+out/eval -- 283 - diff old new 284 - --- old 285 - +++ new 286 - @@ -1,4 +1,10 @@ 287 - -(struct){ 288 - +Errors: 289 - +out.subs.subs: structural cycle: 290 - + ./in.cue:34:17 291 - + 292 - +Result: 293 - +(_|_){ 294 - + // [structural cycle] 295 - #AC: (#struct){ 296 - k: (string){ "simple" } 297 - d: (#struct){ 298 - @@ -14,19 +20,12 @@ 299 - } 300 - } 301 - #R: (#struct){ 302 - - a: (#struct){ |((#struct){ 303 - - k: (string){ "simple" } 304 - - d: (#struct){ 305 - - n: (string){ string } 306 - - } 307 - - }, (#struct){ 308 - - k: (string){ "complex" } 309 - - d: (#struct){ 310 - - n: (string){ string } 311 - - r: (#struct){ 312 - - } 313 - - } 314 - - }) } 315 - + a: (#struct){ 316 - + k: (string){ "simple" } 317 - + d: (#struct){ 318 - + n: (string){ string } 319 - + } 320 - + } 321 - } 322 - #S: (#struct){ 323 - n: (string){ string } 324 - @@ -47,201 +46,122 @@ 325 - } 326 - dict: (#struct){ 327 - } 328 - - let subs#1multi = (〈3;#sub〉 & { 329 - - #p: 〈2;rd〉.a 330 - - }) 331 - + let subs#1multi = &[&[&[&[(〈3;#sub〉 & { 332 - + #p: 〈2;rd〉.a 333 - + })]]]] 334 - } 335 - _test: (struct){ 336 - c1: (#struct){ 337 - - k: (string){ "simple" } 338 - d: (#struct){ 339 - n: (string){ "c1" } 340 - } 341 - + k: (string){ "simple" } 342 - } 343 - s3: (#struct){ 344 - - k: (string){ "complex" } 345 - d: (#struct){ 346 - n: (string){ "s3" } 347 - r: (#struct){ 348 - r1: (#struct){ 349 - a: (#struct){ 350 - - k: (string){ "simple" } 351 - - d: (#struct){ 352 - - n: (string){ "c1" } 353 - - } 354 - - } 355 - - } 356 - - } 357 - - } 358 - + d: (#struct){ 359 - + n: (string){ "c1" } 360 - + } 361 - + k: (string){ "simple" } 362 - + } 363 - + } 364 - + } 365 - + } 366 - + k: (string){ "complex" } 367 - } 368 - s2: (#struct){ 369 - - k: (string){ "complex" } 370 - d: (#struct){ 371 - n: (string){ "s2" } 372 - r: (#struct){ 373 - r1: (#struct){ 374 - a: (#struct){ 375 - - k: (string){ "simple" } 376 - - d: (#struct){ 377 - - n: (string){ "c1" } 378 - - } 379 - - } 380 - - } 381 - - r2: (#struct){ 382 - - a: (#struct){ 383 - - k: (string){ "complex" } 384 - + d: (#struct){ 385 - + n: (string){ "c1" } 386 - + } 387 - + k: (string){ "simple" } 388 - + } 389 - + } 390 - + r2: (#struct){ 391 - + a: (#struct){ 392 - d: (#struct){ 393 - n: (string){ "s3" } 394 - r: (#struct){ 395 - r1: (#struct){ 396 - a: (#struct){ 397 - - k: (string){ "simple" } 398 - - d: (#struct){ 399 - - n: (string){ "c1" } 400 - - } 401 - - } 402 - - } 403 - - } 404 - - } 405 - - } 406 - - } 407 - - } 408 - - } 409 - + d: (#struct){ 410 - + n: (string){ "c1" } 411 - + } 412 - + k: (string){ "simple" } 413 - + } 414 - + } 415 - + } 416 - + } 417 - + k: (string){ "complex" } 418 - + } 419 - + } 420 - + } 421 - + } 422 - + k: (string){ "complex" } 423 - } 424 - s1: (#struct){ 425 - - k: (string){ "complex" } 426 - - d: (#struct){ 427 - - n: (string){ "s1" } 428 - - r: (#struct){ 429 - - r1: (#struct){ 430 - - a: (#struct){ 431 - - k: (string){ "simple" } 432 - - d: (#struct){ 433 - - n: (string){ "c1" } 434 - - } 435 - - } 436 - - } 437 - - r2: (#struct){ 438 - - a: (#struct){ 439 - - k: (string){ "complex" } 440 - - d: (#struct){ 441 - - n: (string){ "s2" } 442 - - r: (#struct){ 443 - - r1: (#struct){ 444 - - a: (#struct){ 445 - - k: (string){ "simple" } 446 - - d: (#struct){ 447 - - n: (string){ "c1" } 448 - - } 449 - - } 450 - - } 451 - - r2: (#struct){ 452 - - a: (#struct){ 453 - - k: (string){ "complex" } 454 - - d: (#struct){ 455 - - n: (string){ "s3" } 456 - - r: (#struct){ 457 - - r1: (#struct){ 458 - - a: (#struct){ 459 - - k: (string){ "simple" } 460 - - d: (#struct){ 461 - - n: (string){ "c1" } 462 - - } 463 - - } 464 - - } 465 - - } 466 - - } 467 - - } 468 - - } 469 - - } 470 - - } 471 - - } 472 - - } 473 - - } 474 - - } 475 - - } 476 - - } 477 - - out: (#struct){ 478 - - #p: (#struct){ 479 - - k: (string){ "complex" } 480 - - d: (#struct){ 481 - - n: (string){ "s1" } 482 - - r: (#struct){ 483 - - r1: (#struct){ 484 - - a: (#struct){ 485 - - k: (string){ "simple" } 486 - - d: (#struct){ 487 - - n: (string){ "c1" } 488 - - } 489 - - } 490 - - } 491 - - r2: (#struct){ 492 - - a: (#struct){ 493 - - k: (string){ "complex" } 494 - - d: (#struct){ 495 - - n: (string){ "s2" } 496 - - r: (#struct){ 497 - - r1: (#struct){ 498 - - a: (#struct){ 499 - - k: (string){ "simple" } 500 - - d: (#struct){ 501 - - n: (string){ "c1" } 502 - - } 503 - - } 504 - - } 505 - - r2: (#struct){ 506 - - a: (#struct){ 507 - - k: (string){ "complex" } 508 - - d: (#struct){ 509 - - n: (string){ "s3" } 510 - - r: (#struct){ 511 - - r1: (#struct){ 512 - - a: (#struct){ 513 - - k: (string){ "simple" } 514 - - d: (#struct){ 515 - - n: (string){ "c1" } 516 - - } 517 - - } 518 - - } 519 - - } 520 - - } 521 - - } 522 - - } 523 - - } 524 - - } 525 - - } 526 - - } 527 - - } 528 - - } 529 - - } 530 - - dict: (#struct){ 531 - - r1: (#struct){ 532 - - a: (#struct){ 533 - - k: (string){ "simple" } 534 - - d: (#struct){ 535 - - n: (string){ "c1" } 536 - - } 537 - - } 538 - - } 539 - - r2_r1: (#struct){ 540 - - a: (#struct){ 541 - - k: (string){ "simple" } 542 - - d: (#struct){ 543 - - n: (string){ "c1" } 544 - - } 545 - - } 546 - - } 547 - - r2_r2_r1: (#struct){ 548 - - a: (#struct){ 549 - - k: (string){ "simple" } 550 - - d: (#struct){ 551 - - n: (string){ "c1" } 552 - - } 553 - - } 554 - - } 555 - - } 556 - - let subs#1multi = (〈3;#sub〉 & { 557 - - #p: 〈2;rd〉.a 558 - - }) 559 - + d: (#struct){ 560 - + n: (string){ "s1" } 561 - + r: (#struct){ 562 - + r1: (#struct){ 563 - + a: (#struct){ 564 - + d: (#struct){ 565 - + n: (string){ "c1" } 566 - + } 567 - + k: (string){ "simple" } 568 - + } 569 - + } 570 - + r2: (#struct){ 571 - + a: (#struct){ 572 - + d: (#struct){ 573 - + n: (string){ "s2" } 574 - + r: (#struct){ 575 - + r1: (#struct){ 576 - + a: (#struct){ 577 - + d: (#struct){ 578 - + n: (string){ "c1" } 579 - + } 580 - + k: (string){ "simple" } 581 - + } 582 - + } 583 - + r2: (#struct){ 584 - + a: (#struct){ 585 - + d: (#struct){ 586 - + n: (string){ "s3" } 587 - + r: (#struct){ 588 - + r1: (#struct){ 589 - + a: (#struct){ 590 - + d: (#struct){ 591 - + n: (string){ "c1" } 592 - + } 593 - + k: (string){ "simple" } 594 - + } 595 - + } 596 - + } 597 - + } 598 - + k: (string){ "complex" } 599 - + } 600 - + } 601 - + } 602 - + } 603 - + k: (string){ "complex" } 604 - + } 605 - + } 606 - + } 607 - + } 608 - + k: (string){ "complex" } 609 - + } 610 - + } 611 - + out: (_|_){ 612 - + // [structural cycle] out.subs.subs: structural cycle: 613 - + // ./in.cue:34:17 614 - } 615 - } 616 - -- diff/todo/p0 -- 617 - out.subs.subs.#p: invalid structural cycle 618 - This seems to be the result of incorrect handling of disjunctions. 619 - -- diff/todo/p3 -- 620 - Reordering 621 97 -- out/evalalpha/stats -- 622 98 Leaks: 2198 623 99 Freed: 231 ··· 801 277 --- old 802 278 +++ new 803 279 @@ -1,9 +1,9 @@ 804 - -Leaks: 6 805 - -Freed: 3232 806 - -Reused: 3213 280 + -Leaks: 7 281 + -Freed: 3218 282 + -Reused: 3200 807 283 -Allocs: 25 808 284 -Retain: 26 809 285 +Leaks: 2198 ··· 812 288 +Allocs: 2198 813 289 +Retain: 0 814 290 815 - -Unifications: 2588 816 - -Conjuncts: 12056 817 - -Disjuncts: 3258 291 + -Unifications: 2577 292 + -Conjuncts: 12017 293 + -Disjuncts: 3244 818 294 +Unifications: 219 819 295 +Conjuncts: 6776 820 296 +Disjuncts: 462 ··· 1144 620 } 1145 621 } 1146 622 -- out/eval/stats -- 1147 - Leaks: 6 1148 - Freed: 3232 1149 - Reused: 3213 623 + Leaks: 7 624 + Freed: 3218 625 + Reused: 3200 1150 626 Allocs: 25 1151 627 Retain: 26 1152 628 1153 - Unifications: 2588 1154 - Conjuncts: 12056 1155 - Disjuncts: 3258 629 + Unifications: 2577 630 + Conjuncts: 12017 631 + Disjuncts: 3244 1156 632 -- out/eval -- 1157 633 (struct){ 1158 634 #AC: (#struct){
+37 -36
cue/testdata/cycle/structural.txtar
··· 541 541 Freed: 800 542 542 Reused: 788 543 543 Allocs: 27 544 - Retain: 61 544 + Retain: 60 545 545 546 546 Unifications: 629 547 547 Conjuncts: 1224 ··· 635 635 p6.#U.#T.a.0.link: structural cycle 636 636 patternFail.issue2374.a.b: structural cycle 637 637 shortPathFail.elipsis.t2.Foo.ref: structural cycle 638 + withLetFail._schema_1: structural cycle 638 639 z1.z.g.h: structural cycle 639 640 p3.a.a: field not allowed: 640 641 ./in.cue:246:5 ··· 646 647 ./in.cue:315:13 647 648 d3.x.0: structural cycle: 648 649 ./in.cue:315:13 649 - withLetFail._schema_1: structural cycle: 650 - ./in.cue:360:17 651 650 e4.a.0.0: cannot combine regular field "c" with [1,{c:1} & (a|{}) & [{c:1}]]: 652 651 ./in.cue:399:11 653 652 e4.a.0.0.0: cannot combine regular field "c" with [1,{c:1}]: ··· 1339 1338 schema: (_|_){ 1340 1339 // [structural cycle] 1341 1340 next: (_|_){ 1342 - // [structural cycle] withLetFail._schema_1: structural cycle: 1343 - // ./in.cue:360:17 1341 + // [structural cycle] withLetFail._schema_1: structural cycle 1344 1342 } 1345 1343 } 1346 1344 let _schema_1#1 = (_|_){ 1347 - // [structural cycle] withLetFail._schema_1: structural cycle: 1348 - // ./in.cue:360:17 1345 + // [structural cycle] withLetFail._schema_1: structural cycle 1349 1346 } 1350 1347 } 1351 1348 listOptOK: (struct){ ··· 1825 1822 e1.a.c: structural cycle 1826 1823 e1.b.c: structural cycle 1827 1824 e2.a.c: structural cycle 1828 - @@ -32,61 +36,81 @@ 1825 + @@ -32,61 +36,80 @@ 1829 1826 ./in.cue:393:5 1830 1827 ./in.cue:394:5 1831 1828 e3.b.c: structural cycle ··· 1902 1899 -withLetFail.schema.next: structural cycle 1903 1900 -z1.z.f.h: structural cycle 1904 1901 +shortPathFail.elipsis.t2.Foo.ref: structural cycle 1902 + +withLetFail._schema_1: structural cycle 1905 1903 z1.z.g.h: structural cycle 1906 1904 -d1.r: structural cycle: 1907 1905 - ./in.cue:299:26 ··· 1917 1915 + ./in.cue:315:13 1918 1916 +d3.x.0: structural cycle: 1919 1917 + ./in.cue:315:13 1920 - +withLetFail._schema_1: structural cycle: 1921 - + ./in.cue:360:17 1922 1918 +e4.a.0.0: cannot combine regular field "c" with [1,{c:1} & (a|{}) & [{c:1}]]: 1923 1919 + ./in.cue:399:11 1924 1920 +e4.a.0.0.0: cannot combine regular field "c" with [1,{c:1}]: ··· 1934 1930 1935 1931 Result: 1936 1932 (_|_){ 1937 - @@ -168,11 +192,17 @@ 1933 + @@ -168,11 +191,17 @@ 1938 1934 } 1939 1935 } 1940 1936 b4: (_|_){ ··· 1957 1953 } 1958 1954 } 1959 1955 x: (_|_){ 1960 - @@ -240,10 +270,9 @@ 1956 + @@ -240,10 +269,9 @@ 1961 1957 // [eval] 1962 1958 0: (_|_){ 1963 1959 // [eval] b6.b.a.0: conflicting values 1 and [1] (mismatched types int and list): ··· 1969 1965 0: (_|_){ 1970 1966 // [structural cycle] b6.b.a.0.0: structural cycle 1971 1967 } 1972 - @@ -261,11 +290,20 @@ 1968 + @@ -261,11 +289,20 @@ 1973 1969 } 1974 1970 } 1975 1971 b7: (_|_){ ··· 1995 1991 } 1996 1992 } 1997 1993 a: (_|_){ 1998 - @@ -304,7 +342,7 @@ 1994 + @@ -304,7 +341,7 @@ 1999 1995 #ref: (#struct){ 2000 1996 ref: (string){ string } 2001 1997 } ··· 2004 2000 c: (#list){ 2005 2001 0: ((string|struct)){ |((string){ string }, (#struct){ 2006 2002 ref: (string){ string } 2007 - @@ -327,7 +365,9 @@ 2003 + @@ -327,7 +364,9 @@ 2008 2004 }) } 2009 2005 } 2010 2006 c: (#struct){ ··· 2015 2011 } 2016 2012 d: (struct){ 2017 2013 d: (struct){ 2018 - @@ -372,7 +412,7 @@ 2014 + @@ -372,7 +411,7 @@ 2019 2015 // [structural cycle] b12b.#list.tail: structural cycle 2020 2016 } 2021 2017 list1: (_|_){ ··· 2024 2020 } 2025 2021 } 2026 2022 b13: (_|_){ 2027 - @@ -455,20 +495,34 @@ 2023 + @@ -455,20 +494,34 @@ 2028 2024 } 2029 2025 a: (_|_){ 2030 2026 // [structural cycle] ··· 2068 2064 #S: (#struct){ 2069 2065 #T: (#struct){ 2070 2066 a: (#struct){ 2071 - @@ -491,7 +545,15 @@ 2067 + @@ -491,7 +544,15 @@ 2072 2068 } 2073 2069 } 2074 2070 a: (_|_){ ··· 2085 2081 } 2086 2082 } 2087 2083 p4: (struct){ 2088 - @@ -532,11 +594,17 @@ 2084 + @@ -532,11 +593,17 @@ 2089 2085 } 2090 2086 a: (_|_){ 2091 2087 // [structural cycle] ··· 2108 2104 } 2109 2105 } 2110 2106 } 2111 - @@ -545,7 +613,7 @@ 2107 + @@ -545,7 +612,7 @@ 2112 2108 } 2113 2109 } 2114 2110 p6: (_|_){ ··· 2117 2113 #S: (#struct){ 2118 2114 #T: (#struct){ 2119 2115 a: (list){ 2120 - @@ -568,7 +636,15 @@ 2116 + @@ -568,7 +635,15 @@ 2121 2117 } 2122 2118 } 2123 2119 a: (_|_){ ··· 2134 2130 } 2135 2131 } 2136 2132 c1: (_|_){ 2137 - @@ -578,12 +654,7 @@ 2133 + @@ -578,12 +653,7 @@ 2138 2134 b: (struct){ 2139 2135 } 2140 2136 c: (_|_){ ··· 2148 2144 } 2149 2145 } 2150 2146 } 2151 - @@ -599,56 +670,30 @@ 2147 + @@ -599,56 +669,30 @@ 2152 2148 // [structural cycle] 2153 2149 h: (int){ int } 2154 2150 t: (_|_){ ··· 2229 2225 } 2230 2226 } 2231 2227 } 2232 - @@ -655,31 +700,41 @@ 2228 + @@ -655,31 +699,41 @@ 2233 2229 } 2234 2230 d3: (_|_){ 2235 2231 // [structural cycle] ··· 2291 2287 } 2292 2288 } 2293 2289 shortPathFail: (_|_){ 2294 - @@ -696,9 +751,7 @@ 2290 + @@ -696,9 +750,7 @@ 2295 2291 // [structural cycle] 2296 2292 t1: (struct){ 2297 2293 #Foo: (#struct){ ··· 2302 2298 } 2303 2299 } 2304 2300 t2: (_|_){ 2305 - @@ -706,10 +759,7 @@ 2301 + @@ -706,10 +758,7 @@ 2306 2302 Foo: (_|_){ 2307 2303 // [structural cycle] 2308 2304 ref: (_|_){ ··· 2314 2310 } 2315 2311 } 2316 2312 } 2317 - @@ -740,7 +790,8 @@ 2313 + @@ -740,12 +789,11 @@ 2318 2314 schema: (_|_){ 2319 2315 // [structural cycle] 2320 2316 next: (_|_){ 2321 2317 - // [structural cycle] withLetFail.schema.next: structural cycle 2322 - + // [structural cycle] withLetFail._schema_1: structural cycle: 2323 - + // ./in.cue:360:17 2318 + + // [structural cycle] withLetFail._schema_1: structural cycle 2324 2319 } 2325 2320 } 2326 2321 let _schema_1#1 = (_|_){ 2327 - @@ -801,11 +852,12 @@ 2322 + - // [structural cycle] withLetFail._schema_1: structural cycle: 2323 + - // ./in.cue:360:17 2324 + + // [structural cycle] withLetFail._schema_1: structural cycle 2325 + } 2326 + } 2327 + listOptOK: (struct){ 2328 + @@ -801,11 +849,12 @@ 2328 2329 // [eval] e3.a: conflicting values [a] and {c:a} (mismatched types list and struct): 2329 2330 // ./in.cue:390:5 2330 2331 // ./in.cue:391:5 ··· 2342 2343 } 2343 2344 } 2344 2345 b: (_|_){ 2345 - @@ -812,11 +864,12 @@ 2346 + @@ -812,11 +861,12 @@ 2346 2347 // [eval] e3.b: conflicting values [b] and {c:b} (mismatched types list and struct): 2347 2348 // ./in.cue:393:5 2348 2349 // ./in.cue:394:5 ··· 2360 2361 } 2361 2362 } 2362 2363 } 2363 - @@ -825,41 +878,51 @@ 2364 + @@ -825,41 +875,51 @@ 2364 2365 a: (_|_){ 2365 2366 // [eval] 2366 2367 0: (_|_){ ··· 2443 2444 } 2444 2445 } 2445 2446 } 2446 - @@ -882,19 +945,14 @@ 2447 + @@ -882,19 +942,14 @@ 2447 2448 y: (_|_){ 2448 2449 // [eval] 2449 2450 0: (_|_){ ··· 2466 2467 } 2467 2468 1: (int){ 1 } 2468 2469 } 2469 - @@ -904,19 +962,14 @@ 2470 + @@ -904,19 +959,14 @@ 2470 2471 y: (_|_){ 2471 2472 // [eval] 2472 2473 0: (_|_){ ··· 2489 2490 } 2490 2491 1: (int){ 1 } 2491 2492 } 2492 - @@ -1020,9 +1073,7 @@ 2493 + @@ -1020,9 +1070,7 @@ 2493 2494 // [structural cycle] 2494 2495 f: (_|_){ 2495 2496 // [structural cycle] ··· 2500 2501 } 2501 2502 g: (_|_){ 2502 2503 // [structural cycle] 2503 - @@ -1169,19 +1220,19 @@ 2504 + @@ -1169,19 +1217,19 @@ 2504 2505 } 2505 2506 } 2506 2507 n4: (struct){
+5 -9
cue/testdata/eval/conjuncts.txtar
··· 80 80 Disjuncts: 184 81 81 -- out/evalalpha -- 82 82 Errors: 83 - issue2351.let.param: conflicting values [{}] and "foo" (mismatched types list and string): 83 + issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 84 84 ./issue2351.cue:2:15 85 85 ./issue2351.cue:4:19 86 86 ··· 116 116 issue2351: (_|_){ 117 117 // [eval] 118 118 let: (_|_){ 119 - // [eval] issue2351.let.param: conflicting values [{}] and "foo" (mismatched types list and string): 119 + // [eval] issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 120 120 // ./issue2351.cue:2:15 121 121 // ./issue2351.cue:4:19 122 122 let _param#1 = (string){ "foo" } ··· 181 181 +++ new 182 182 @@ -1,7 +1,6 @@ 183 183 Errors: 184 - -issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 185 - +issue2351.let.param: conflicting values [{}] and "foo" (mismatched types list and string): 184 + issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 186 185 ./issue2351.cue:2:15 187 186 - ./issue2351.cue:3:2 188 187 ./issue2351.cue:4:19 ··· 210 209 } 211 210 handleComprehensions: (struct){ 212 211 #sub2: (int){ 2 } 213 - @@ -37,9 +35,8 @@ 214 - issue2351: (_|_){ 215 - // [eval] 212 + @@ -39,7 +37,6 @@ 216 213 let: (_|_){ 217 - - // [eval] issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 218 - + // [eval] issue2351.let.param: conflicting values [{}] and "foo" (mismatched types list and string): 214 + // [eval] issue2351.let.param: conflicting values "foo" and [{}] (mismatched types string and list): 219 215 // ./issue2351.cue:2:15 220 216 - // ./issue2351.cue:3:2 221 217 // ./issue2351.cue:4:19
+104 -61
cue/testdata/eval/issue2146.txtar
··· 52 52 -- out/evalalpha -- 53 53 (struct){ 54 54 p1: (struct){ 55 - #A: (#struct){ 56 - x?: (int){ int } 57 - y?: (int){ int } 58 - let list#1 = (#list){ 59 - 0: (int){ int } 60 - 1: (int){ int } 61 - } 62 - all: (#list){ 63 - } 64 - } 55 + #A: (#struct){ |(*(#struct){ 56 + x?: (_|_){ 57 + // [user] explicit error (_|_ literal) in source: 58 + // ./in.cue:10:8 59 + } 60 + y: (int){ 1 } 61 + let list#1 = (_|_){ 62 + // [user] 63 + 0: (_|_){ 64 + // [user] explicit error (_|_ literal) in source: 65 + // ./in.cue:10:8 66 + } 67 + 1: (int){ 1 } 68 + } 69 + all: (#list){ 70 + 0: (int){ 1 } 71 + } 72 + }, (#struct){ 73 + x?: (int){ int } 74 + y?: (int){ int } 75 + let list#1 = (#list){ 76 + 0: (int){ int } 77 + 1: (int){ int } 78 + } 79 + all: (#list){ 80 + } 81 + }) } 65 82 a: (#struct){ 66 83 x: (int){ 3 } 67 84 y?: (int){ int } ··· 86 103 } 87 104 } 88 105 p2: (struct){ 89 - #A: (#struct){ 90 - x?: (int){ int } 91 - y?: (int){ int } 92 - let list#2 = (#list){ 93 - 0: (int){ int } 94 - 1: (int){ int } 95 - } 96 - all: (#list){ 97 - } 98 - } 106 + #A: (#struct){ |(*(#struct){ 107 + x?: (_|_){ 108 + // [user] explicit error (_|_ literal) in source: 109 + // ./in.cue:27:8 110 + } 111 + y: (int){ 1 } 112 + let list#2 = (_|_){ 113 + // [user] 114 + 0: (_|_){ 115 + // [user] explicit error (_|_ literal) in source: 116 + // ./in.cue:27:8 117 + } 118 + 1: (int){ 1 } 119 + } 120 + all: (#list){ 121 + 0: (int){ 1 } 122 + } 123 + }, (#struct){ 124 + x?: (int){ int } 125 + y?: (int){ int } 126 + let list#2 = (#list){ 127 + 0: (int){ int } 128 + 1: (int){ int } 129 + } 130 + all: (#list){ 131 + } 132 + }) } 99 133 a: (#struct){ 100 134 x: (int){ 3 } 101 135 y: (int){ 2 } ··· 126 160 diff old new 127 161 --- old 128 162 +++ new 129 - @@ -1,58 +1,33 @@ 130 - (struct){ 131 - p1: (struct){ 132 - - #A: (#struct){ |(*(#struct){ 133 - - x?: (_|_){ 134 - - // [user] explicit error (_|_ literal) in source: 135 - - // ./in.cue:10:8 136 - - } 137 - - y: (int){ 1 } 163 + @@ -6,53 +6,45 @@ 164 + // ./in.cue:10:8 165 + } 166 + y: (int){ 1 } 138 167 - let list#1 = (#list){ 139 168 - 0: (_|_){ 140 169 - // [incomplete] p1.#A.list.0: cannot reference optional field: x: ··· 182 211 - 〈1;x〉, 183 212 - 〈1;y〉, 184 213 - ] 185 - + #A: (#struct){ 186 - + x?: (int){ int } 187 - + y?: (int){ int } 188 - + let list#1 = (#list){ 189 - + 0: (int){ int } 190 - + 1: (int){ int } 191 - + } 192 - + all: (#list){ 193 - + } 194 - + } 214 + + let list#1 = (_|_){ 215 + + // [user] 216 + + 0: (_|_){ 217 + + // [user] explicit error (_|_ literal) in source: 218 + + // ./in.cue:10:8 219 + + } 220 + + 1: (int){ 1 } 221 + + } 222 + + all: (#list){ 223 + + 0: (int){ 1 } 224 + + } 225 + + }, (#struct){ 226 + + x?: (int){ int } 227 + + y?: (int){ int } 228 + + let list#1 = (#list){ 229 + + 0: (int){ int } 230 + + 1: (int){ int } 231 + + } 232 + + all: (#list){ 233 + + } 234 + + }) } 195 235 + a: (#struct){ 196 236 + x: (int){ 3 } 197 237 + y?: (int){ int } ··· 213 253 all: (#list){ 214 254 0: (int){ 3 } 215 255 } 216 - @@ -59,57 +34,35 @@ 217 - } 218 - } 219 - p2: (struct){ 220 - - #A: (#struct){ |(*(#struct){ 221 - - x?: (_|_){ 222 - - // [user] explicit error (_|_ literal) in source: 223 - - // ./in.cue:27:8 224 - - } 225 - - y: (int){ 1 } 256 + @@ -65,51 +57,46 @@ 257 + // ./in.cue:27:8 258 + } 259 + y: (int){ 1 } 226 260 - let list#2 = (#list){ 227 261 - 0: (_|_){ 228 262 - // [incomplete] p2.#A.list.0: cannot reference optional field: x: ··· 268 302 - 〈1;x〉, 269 303 - 〈1;y〉, 270 304 - ] 271 - + #A: (#struct){ 272 - + x?: (int){ int } 273 - + y?: (int){ int } 274 - + let list#2 = (#list){ 275 - + 0: (int){ int } 276 - + 1: (int){ int } 277 - + } 278 - + all: (#list){ 279 - + } 280 - + } 305 + + let list#2 = (_|_){ 306 + + // [user] 307 + + 0: (_|_){ 308 + + // [user] explicit error (_|_ literal) in source: 309 + + // ./in.cue:27:8 310 + + } 311 + + 1: (int){ 1 } 312 + + } 313 + + all: (#list){ 314 + + 0: (int){ 1 } 315 + + } 316 + + }, (#struct){ 317 + + x?: (int){ int } 318 + + y?: (int){ int } 319 + + let list#2 = (#list){ 320 + + 0: (int){ int } 321 + + 1: (int){ int } 322 + + } 323 + + all: (#list){ 324 + + } 325 + + }) } 281 326 + a: (#struct){ 282 327 + x: (int){ 3 } 283 328 + y: (int){ 2 } ··· 300 345 all: (#list){ 301 346 0: (int){ 3 } 302 347 1: (int){ 2 } 303 - -- diff/todo/p1 -- 304 - p1: missing disjuncts in result. 305 348 -- diff/todo/p3 -- 306 349 Let expressions encoded differently. 307 350 -- out/eval --
+2 -2
cue/testdata/eval/issue2235.txtar
··· 104 104 Freed: 101 105 105 Reused: 84 106 106 Allocs: 20 107 - Retain: 72 107 + Retain: 69 108 108 109 109 Unifications: 104 110 110 Conjuncts: 271 111 - Disjuncts: 161 111 + Disjuncts: 160 112 112 -- out/evalalpha -- 113 113 (struct){ 114 114 shorewallParams: (#struct){
+2 -2
cue/testdata/eval/let.txtar
··· 556 556 Freed: 158 557 557 Reused: 149 558 558 Allocs: 61 559 - Retain: 184 559 + Retain: 151 560 560 561 561 Unifications: 196 562 562 Conjuncts: 365 563 - Disjuncts: 241 563 + Disjuncts: 242 564 564 -- out/eval -- 565 565 Errors: 566 566 indirectReference.y: conflicting values 2 and 1:
+5 -5
cue/testdata/export/issue2244.txtar
··· 32 32 if: _#isReleaseTag 33 33 } 34 34 -- out/eval/stats -- 35 - Leaks: 16 36 - Freed: 17 37 - Reused: 13 38 - Allocs: 20 35 + Leaks: 24 36 + Freed: 14 37 + Reused: 10 38 + Allocs: 28 39 39 Retain: 30 40 40 41 41 Unifications: 24 42 42 Conjuncts: 58 43 - Disjuncts: 40 43 + Disjuncts: 39 44 44 -- diff/explanation -- 45 45 New evaluator should ultimately disallow new definitions in closed structs 46 46 and not allow #pattern in #step
+10 -23
cue/testdata/references/let.txtar
··· 285 285 } 286 286 } 287 287 -- out/eval/stats -- 288 - Leaks: 3 289 - Freed: 112 288 + Leaks: 2 289 + Freed: 114 290 290 Reused: 107 291 - Allocs: 8 292 - Retain: 10 291 + Allocs: 9 292 + Retain: 14 293 293 294 - Unifications: 115 295 - Conjuncts: 169 296 - Disjuncts: 117 294 + Unifications: 116 295 + Conjuncts: 166 296 + Disjuncts: 121 297 297 -- out/evalalpha -- 298 298 (struct){ 299 299 a1list: (#list){ ··· 494 494 // ./in.cue:54:17 495 495 } 496 496 } 497 - @@ -173,9 +173,9 @@ 498 - } 499 - b: (string){ 500 - "b" 501 - - let List#11 = (_|_){ 502 - - // [incomplete] issue1116.b.List: cycle error referencing #a: 503 - - // ./in.cue:96:14 504 - + let List#11 = (#list){ 505 - + 0: (string){ "a" } 506 - + 1: (string){ "b" } 507 - } 508 - #a: (#list){ 509 - 0: (string){ "a" } 510 497 -- diff/todo/p3 -- 511 498 Investigate let divergence. Probably okay. 512 499 -- out/eval -- ··· 685 672 } 686 673 b: (string){ 687 674 "b" 688 - let List#11 = (_|_){ 689 - // [incomplete] issue1116.b.List: cycle error referencing #a: 690 - // ./in.cue:96:14 675 + let List#11 = (#list){ 676 + 0: (string){ "a" } 677 + 1: (string){ "b" } 691 678 } 692 679 #a: (#list){ 693 680 0: (string){ "a" }
+8 -13
cue/testdata/resolve/035_excluded_embedding_from_closing.txtar
··· 77 77 Disjuncts: 21 78 78 -- out/evalalpha -- 79 79 Errors: 80 + V.b.extra: field not allowed: 81 + ./in.cue:11:5 80 82 V.c.e: field not allowed: 81 83 ./in.cue:10:5 82 - V.b.extra: field not allowed: 83 - ./in.cue:7:5 84 - ./in.cue:11:5 85 84 86 85 Result: 87 86 (_|_){ ··· 114 113 // [eval] 115 114 extra: (_|_){ 116 115 // [eval] V.b.extra: field not allowed: 117 - // ./in.cue:7:5 118 116 // ./in.cue:11:5 119 117 } 120 118 open: (int){ int } ··· 131 129 diff old new 132 130 --- old 133 131 +++ new 134 - @@ -1,14 +1,9 @@ 132 + @@ -1,13 +1,7 @@ 135 133 Errors: 136 - +V.c.e: field not allowed: 137 - + ./in.cue:10:5 138 134 V.b.extra: field not allowed: 139 135 - ./in.cue:6:10 140 - ./in.cue:7:5 136 + - ./in.cue:7:5 141 137 - ./in.cue:9:4 142 138 ./in.cue:11:5 143 - -V.c.e: field not allowed: 139 + V.c.e: field not allowed: 144 140 - ./in.cue:3:2 145 141 - ./in.cue:4:6 146 142 - ./in.cue:9:4 147 - - ./in.cue:10:5 143 + ./in.cue:10:5 148 144 149 145 Result: 150 - (_|_){ 151 - @@ -29,33 +24,28 @@ 146 + @@ -29,33 +23,27 @@ 152 147 } 153 148 V: (_|_){ 154 149 // [eval] ··· 176 171 extra: (_|_){ 177 172 // [eval] V.b.extra: field not allowed: 178 173 - // ./in.cue:6:10 179 - // ./in.cue:7:5 174 + - // ./in.cue:7:5 180 175 - // ./in.cue:9:4 181 176 // ./in.cue:11:5 182 177 }
+2 -9
internal/core/adt/expr.go
··· 901 901 // In other words, a Vertex is not necessarily erroneous when a let 902 902 // field contained in that Vertex is erroneous. 903 903 904 - // TODO(order): Do not finalize? Although it is safe to finalize a let 905 - // by itself, it is not necessarily safe, at this point, to finalize any 906 - // references it makes. Originally, let finalization was requested to 907 - // detect cases where multi-mode should be enabled. With the recent compiler 908 - // changes, though, this should be detected statically. Leave this on for 909 - // now, though, as it is not entirely clear it is fine to remove this. 910 - // We can reevaluate this once we have redone some of the planned order of 911 - // evaluation work. 912 - arc.Finalize(ctx) 904 + // We should only partly finalize the result here as it is not safe to 905 + // finalize any references made by the let. 913 906 b := arc.Bottom() 914 907 if !arc.MultiLet && b == nil { 915 908 return arc