Skip to content

Commit b83ae37

Browse files
committed
doc/ref: the subsumption relation for fields was backwards
Intuitively, a regular field is more concrete than a required field, as unifying `{a: x}` with `{a!: x}` results in a regular field, like unifying `3` with `int` results in `3`, as it is more concrete. Similarly, a required field is more concrete than an optional field. This is because unifying `{a!: x}` with `{a?: x}` results in a required field, which makes intuitive sense - the empty struct `{}` can unify with `{a?: x}` but not with `{a!: x}`. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I8897ed4356514bb32990797fe3e5bbab783303ff Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194644 Reviewed-by: Paul Jolly <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 6c5f6e7 commit b83ae37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/ref/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ as long as it is not unified with a defined field.
10961096

10971097
The subsumption relation for fields with the various markers is defined as
10981098
```
1099-
{a?: x} ⊑ {a!: x} ⊑ {a: x}
1099+
{a: x} ⊑ {a!: x} ⊑ {a?: x}
11001100
```
11011101
for any given `x`.
11021102

0 commit comments

Comments
 (0)