Skip to content

Commit

Permalink
internal/core/adt: fix let issue for eval v3
Browse files Browse the repository at this point in the history
CL https://cuelang.org/cl/1199752
broke let evaluation in certain cases.
For eval v2, this was fixed in CL
https://cuelang.org/cl/1206279
This fixes it for eval v3.

The bug was that a let was not marked as a "multi"
let when it actually was. The Finalize that was there
before the regression would paper over this bug and
go into "multi" handling regardless. We reenabled the
use of Final in a previous CL for eval v2.

For eval v3 we now unconditionally set a let as "multi"
if it originates from a comprehensions. This obviates
the need to recursively evaluate the let ahead of time.
This may reduce performance, but is at least correct.

To not negatively affect V2, we only implement this
for V3.

Fixes #3590
Fixes #3591

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: If4fc813d682df7782e3be807469e0021dd7508e3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1206280
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
mpvl committed Dec 23, 2024
1 parent 2702426 commit e6cb9b3
Show file tree
Hide file tree
Showing 5 changed files with 465 additions and 285 deletions.
Loading

0 comments on commit e6cb9b3

Please sign in to comment.