You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/core/adt: evaluate pattern values when registering them
The or() builtin returns a Disjunction holding raw, unevaluated list
elements. When such a value was used as a pattern label, the pattern
was registered as-is, deferring evaluation of its branches until
matchPatternValue force-finalized them upon a later field insertion.
At that point a node the branches depend on may be mid-evaluation, so
a comprehension over it would see a partial field set, collapsing the
inner or() and locking the spurious result in permanently.
Evaluate vertices held by a pattern value when the pattern constraint
task runs, mirroring what already happens for resolvers and literal
disjunctions used as pattern labels: at this point dependencies can
still be run reentrantly, or block and requeue the task. This keeps
or() lazy in all other contexts, retaining the performance win of
returning a Disjunction directly.
Fixes#4399
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I5ba836a2a24343b6b6ce1a03c192cf0a5e75b7f4
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1242737
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
0 commit comments