-
Notifications
You must be signed in to change notification settings - Fork 171
cmd/cue: no error in presence of apparently empty list passed to or builtin #475
Comments
Not nesting the definitions is wrong, because subsequently using them in |
The problem with On the other hand, if it returns a disjunction, and it is unified with a concrete value, then down the line if a definition is used somewhere where the comprehension source is expanded, even there a unification failure may be (correctly) turned into a correct value. This seems to indicate that a failure within a definition should not be terminal for the entire configuration, or that there can also be "open" disjunctions. |
Indeed, which is exactly what my intuition tells me, but as I mentioned above I can't honestly say that I could point (someone) to a precise explanation in the spec that articulates this. Where would you refer someone on this point? Thanks for the explanation on the |
It can be derived from the spec, but it is not obvious. There really should be a language guide and/or something like "Effective CUE". |
Completely agree. I just wondered whether this should actually be made more obvious from the spec, but I definitely defer on that point! |
Closed due to typo. Reopening. |
Consider also
See #601 |
This issue has been migrated to cue-lang/cue#475. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Consider first
x.cue
:cue eval -c x.cue
gives no error, despite the fact that"t2"
references a non-existent terminal.If instead we move the definitions of
#Step
et al inside#Guide
:Then
cue eval -c y.cue
gives:I suspect the poor error message is to be expected in this release. But at least in this case the error is caught (changing
"t2"
to"t1"
fixes the problem).Not nesting the definitions (the approach in
x.cue
) feels "wrong" but I can't articulate why. In any case, it feels like there should be an error of some sort in that case because I assume from the lack of error relating to the fact that"t2"
is not in the list["t1"]
then the list must be empty. But this should result in an error becauseor
cannot be passed an empty list AFAIK.Apologies if the language above is a bit loose, but hopefully I've managed to convey the gist of my understanding/the problem.
The text was updated successfully, but these errors were encountered: