Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/filetypes: avoid struct-valued defaults
Various places in `internal/filetypes/types.cue` use a pattern like this: encodings: cue: { *forms.schema | _ } where the `*forms.schema` value is a struct. This seems unlikely to be what's intended: it means that if a single value inside `encoding.cue` is inconsistent with `forms.schema`, all the rest of the fields in `forms.schema` will be discarded, leaving no defaults at all. There are four places in the code that this pattern is used. As it happens, none of the attributes which are set by the struct-valued default can possibly conflict with anything (all values are set to false and there is nowhere that sets a non-default true value), so this change should not change observable behaviour in any way. Also remove a redundant field definition inside `forms.schema`. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I47e1a78ae4ac868966099bf85c0e5731aa7b78b6 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200763 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information