Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Struct openness in definition #527

Answered by myitcv
eonpatapon asked this question in General
Sep 17, 2020 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

Can you clarify what you are trying to achieve with your #A definition? Because currently (emphasis important, see below) it is equivalent to:

#A: {
        c: {
                {
                        [string]: #B
                }
                foo: _
                bar: _
        }
}

which basically says that all the fields of c (including foo and bar) must be of type #B. This constraint does not preclude additional fields beyond foo and bar, just so long as those additional fields are of type #B.

In the near future (not yet implemented), the semantics are going to change to those detailed in the spec: https://tip.cuelang.org/docs/references/spec/#structs. (This was also detailed…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@myitcv
Comment options

@myitcv
Comment options

@eonpatapon
Comment options

@eonpatapon
Comment options

@myitcv
Comment options

Answer selected by eonpatapon
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants