This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: "fix" disjunction resolution
The recent performance improvement eliminated disjuncts too aggressively, causing some disjuncts to disappear. Early elimination prevents exponential blowup, but of course it should not make it incorrect. Note that for most common uses, like protobuf and K8s structs with discriminator fields, special optimizations exist that make this linear. But this has not been implemented yet. Now this fix exposed another bug. This bug was deliberate to work around a limitation of default values when representing oneOf fields. We planned to introduce a "required field" annotation which would also allow to represent these kind of semantics much more elegantly. For now, though, we are stuck in a position that more than one oneOf field cannot be represented properly with defaults. We fix it for now in an even more AWFUL way, and instead work towards a proper solution based on required fields. Issue #726 Change-Id: Id4bcd0445612e12fba48a744654de4e1852c552e Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8641 Reviewed-by: Paul Jolly <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
- Loading branch information
Showing
6 changed files
with
365 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.