Skip to content

Commit

Permalink
internal/core/compile: various fixes to matchN
Browse files Browse the repository at this point in the history
Ensure that unfulfilled required fields are
treated as errors. This requires a final validation step.

Several other changes were made it the process.
- mark builtin as NonConcrete.
  This also allows disjunctions to be passed as bounds.
- call Validate, instead of just checking the error of a
  schema check. This catches unresolved required fields.
- handle some cases where we can mark matchN as
  guaranteed to be failing. If in doubt, we mark
  the error as "incomplete", so that the validator
  will be kept around.

Note that this also exposes another issue:
not satisfying a required field is an incomplete
error. The validator should mark that as such.

Fixes #3409

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Icdbd0511cd4bb711aa64ef0998e7185c536bc1ab
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200349
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
mpvl committed Sep 2, 2024
1 parent 30a8854 commit e505402
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 123 deletions.
Loading

0 comments on commit e505402

Please sign in to comment.