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
Is this because of the following line in the spec?
A struct that is the result of unifying any struct with a ... declaration is defined for all regular fields.
That sentence seems somewhat misleading to me FWIW.
For example:
#a: {...}
#b: {a?: int}
#c: #a & #b
#c: b: 2
The above example gives an error even though #c is "the result of unifying any struct with a ... declaration" AFAICS, and that seems like correct behaviour to me.
Note that if closing really did close up ... fields, then ellipses would be essentially useless because a definition would also close (recursively) any ellipses within the definition so, for example:
#a: {
...
}
would not allow any fields.
Perhaps we should add an example to the spec, because I wasn't aware of this quirk.
The spec could definitely use improvement in this area.
For example, it says:
Closing a struct is equivalent to adding ..._|_ to it.
but it's not clear what {..., ... _|_} should mean, which is what that sentence implies
would happen when there's an ellipsis already present.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes (v0.10.0)
What did you do?
What did you expect to see?
Passing test. Closing a struct with an ellipsis should not disallow fields in that struct.
What did you see instead?
The text was updated successfully, but these errors were encountered: