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
Ah! OK, that simplifies things. It also explains why i've found some of the discussion around required fields, e.g. #822, confusing - my mental model has been off. FWIW, i think i was thrown off by this wording in the docs:
Use the Raw option to do a low-level subsumption, taking defaults into account.
In retrospect, i realize that i made an incorrect inference here - that doc refers to whether defaults on two existing fields are considered in subsumption, not on whether a default in the subsumer obviates the need for field existence in the instance. I thought it referred to both; that it refers only to the former is certainly simpler, and i'm delighted to have clarified a previously fuzzy area of my CUE mental model.
All that said, i think part of the reason i made this erroneous inference in the first place was because i've narrowed my thinking to the one use case: authoring schema in CUE, but working with them primarily from other languages, and therefore using concrete objects. In that context, conflating these ideas makes sense - once an object has 'left' CUE, where the value came from doesn't really matter anymore. However, this starts veering into trickier territory about openness and closedness that i haven't figured out how to discuss yet - and is out of scope for this issue, as Subsume() is clearly behaving as expected.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Checked for subsumption using
cue.Raw()
between two values that differ only by a field that has a default marker.What did you expect to see?
That
#two
subsumes#one
, when considering defaults (as thecue.Raw()
docs indicate).What did you see instead?
The text was updated successfully, but these errors were encountered: