Skip to content

Commit

Permalink
internal/core/adt: order bound error messages
Browse files Browse the repository at this point in the history
In the negative case for numbers, the highest
number comes first in the error message.
Reorder this to be consistent and clearer.

Also indicate the number type for numeric out
of bound errors. This is especially useful
for checking integer values when the bounds
themselves have floats. For instance,

	a: int & <=1.3 & >=1.1

is valid CUE, due to how comparators are defined,
but before resulted in the rather confusing error
message:

	a: incompatible bounds <=1.3 and >=1.1:

This has now change to state "incompatible
integer bounds".

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I225f00cd5d0e3c38d49163dde462609b98e46198
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205398
Reviewed-by: Matthew Sackman <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mpvl committed Dec 9, 2024
1 parent f9e5b6a commit d298a53
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 197 deletions.
Loading

0 comments on commit d298a53

Please sign in to comment.