This commit is contained in:
KtorZ 2024-09-06 12:27:53 +02:00
parent 888b7e34c6
commit 19e30b10f9
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
2 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,19 @@
# Changelog
## v1.1.1 - UNRELEASED
### Added
- N/A
### Changed
- **aiken-lang**: Fix underflow in error message reported by the validator arity. See [#1013](https://github.com/aiken-lang/aiken/issues/1013) @KtorZ.
### Removed
- N/A
## v1.1.0 - 2024-09-03
### Added

View File

@ -982,9 +982,9 @@ The best thing to do from here is to remove it."#))]
#[error("Validators require at least 2 arguments and at most 3 arguments.\n")]
#[diagnostic(code("illegal::validator_arity"))]
#[diagnostic(help(
"Please {}.\nIf you don't need one of the required arguments use an underscore (e.g. `_datum`).",
if *count < 2 {
let missing = 2 - count;
"Please {}. If you don't need one of the required arguments use an underscore (e.g. `_datum`).",
if *count < *expected {
let missing = expected - count;
let mut arguments = "argument".to_string();
@ -997,7 +997,7 @@ The best thing to do from here is to remove it."#))]
missing.to_string().if_supports_color(Stdout, |s| s.yellow()),
)
} else {
let extra = count - 3;
let extra = count - expected;
let mut arguments = "argument".to_string();