Skip to content

Commit

Permalink
doc/spec: specify default constraint is not implemented
Browse files Browse the repository at this point in the history
For cue-lang#1109

Signed-off-by: Cuichen Li <cuichli@cisco.com>
Change-Id: Iaa5863923a80fd14e23bd1606e2acba0ee15b4fa
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/533342
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
cuichenli authored and myitcv committed Feb 17, 2022
1 parent e0577bb commit 1c52d6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/ref/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,8 @@ Expression Result (without optional fields)
```

A struct may define constraints that apply to fields that are added when unified
with another struct using pattern or default constraints.
with another struct using pattern or default constraints (_Note_: default
constraints are not yet implemented).

A _pattern constraint_, denoted `[pattern]: value`, defines a pattern, which
is a value of type string, and a value to unify with fields whose label
Expand All @@ -1086,14 +1087,15 @@ whose label does not unify with any of the patterns of the pattern
constraints defined for `a` _and_ for which there exists no field in `a`
with that label.
The token `...` is a shorthand for `..._`.
_Note_: default constraints are not yet implemented.


```
a: {
foo: string // foo is a string
[=~"^i"]: int // all other fields starting with i are integers
[=~"^b"]: bool // all other fields starting with b are booleans
...string // all other fields must be a string
...string // all other fields must be a string. Note: default constraints are not yet implemented.
}
b: a & {
Expand Down

0 comments on commit 1c52d6a

Please sign in to comment.