Expr() behave wierdly when disjuction #1244
Unanswered
ying-jeanne
asked this question in
General
Replies: 2 comments 7 replies
-
Defaults are confusing, and I'm not expert here, but my hunch is that the evaluator may be seeing this as a type with a default (perhaps as an optimization) rather than as a disjunction. These lines from the spec lead me to this hunch
What happens if you add more types or concrete values to the disjunction? (so that it contains more than two expected elements) |
Beta Was this translation helpful? Give feedback.
7 replies
-
Notwithstanding the issues raised in #1317, there also appears to be an issue with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to figure out how Expr() works, tested with some snippets:
https://github.com/ying-jeanne/cue_test_cases/blob/bf84db6edba61d3479838967d7445f1775393fc3/main.go
the print is showed:
what seems weird is for the case cueObj1, the expr() returned *4 | int as one single element, is that normal and how i can make it return the list of elements like *4 and int with a size of result of 2?
Not important for this issue, but this code would be used as a part of program to check whether we have doubled defaults for all cue object.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions