-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: shorter validator error message
Validator errors can get very long, dwarfing the rest of the errors, as the validator error currently prints the entire source expression that's being validated. It's made worse by the fact that references have been expanded at this point. This is not the approach taken by most validation failures: instead we can rely on the fact that the source expression is available at the the source locations referred to by the error. So we change the error to include only the name of the validator when the validator can take non-concrete arguments, because those seem to be the biggest culprits here. Also, having a string-returning method is a little more convenient for obtaining the qualified name of a builtin, and there's no need for it to be exported, so rename it to `qualifiedName`. Also, there's no need to build the buffer with the arguments when we're not going to use it, so move the `Unwrap` test before that, which should not alter semantics. Fixes #3550. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Ic4586fd3a335263ff9309b8c5b47f06a30fefc17 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1203562 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
- Loading branch information
Showing
14 changed files
with
160 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.