-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eval: default value resolution issue #770
Comments
Original reply by @mpvl in cuelang/cue#770 (comment) This could be. As the release notes remarked (IIRC), the implementation is not entirely correct. We have slightly changed the definition and reimplemented it. Funnily enough the bug of #763 was fixed initially by this change as a result of the restructuring, but then the new semantics reintroduced the bug (completely different mechanism, same result). The issue is that an existing optimization is no longer valid under the new semantics. We plan to undo that optimization anyway as part of a different effort, so we decided to do this later. The commit message of the fix and comments in the code explain it in a bit more depth. We didn't expect that users would go "a level deeper" that quickly. :) To help us prioritize, is this a blocker for you? |
Original reply by @eonpatapon in cuelang/cue#770 (comment) Not really as I can just use |
Original reply by @eonpatapon in cuelang/cue#770 (comment) Thanks for the quick intial fix btw :) |
The original program still fails as of master today:
However, the new evaluator with the new disjunctions algorithm correctly handles this:
I'll close this issue by adding a regression test for the new evaluator :) |
As can be seen in the diff, the old evaluator resulted in the fields: h: a: v: *"a" | "b" | "c" h: b: v: *"a" | "b" | "c" h: c: v: *"a" | *"b" | *"c" Which, when exporting, would understandably result in an error: h.c.v: incomplete value "a" | "b" | "c" The new evaluator correctly keeps "a" as the only default in all fields: h: a: v: *"a" | "b" | "c" h: b: v: *"a" | "b" | "c" h: c: v: *"a" | "b" | "c" Closes #770. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Id3e5e9c522307900331dc0fa29b936f773750497
Originally opened by @eonpatapon in cuelang/cue#770
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Following on #763, there is still some funking things going on.
While the repro case of #763 is fixed if I add another level it fails the same:
What did you expect to see?
What did you see instead?
beta.4
beta.5
The text was updated successfully, but these errors were encountered: