diff options
author | Florian Klink <flokli@flokli.de> | 2024-06-25T19·51+0300 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-06-26T04·51+0000 |
commit | 970e2a045bb051861f65b19d8ede144b271ecd4b (patch) | |
tree | ac3f87c4f1e16c7578b509173e08985be15fdaec | |
parent | ea6f51124108361d2e9946ba1122ba7384173722 (diff) |
refactor(tvix/eval): rename UnexpectedArgument{,Formals} r/8308
There's other places where unexpected arguments can be provided, like in builtins. Make space for that error type. Change-Id: Ic831497a3a1dd36a3a184bedadcf1374bf0ae6db Reviewed-on: https://cl.tvl.fyi/c/depot/+/11876 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
-rw-r--r-- | tvix/eval/src/errors.rs | 10 | ||||
-rw-r--r-- | tvix/eval/src/vm/mod.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index a5f79c235f09..1778fc3f1c3d 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -185,7 +185,7 @@ pub enum ErrorKind { FromTomlError(String), /// An unexpected argument was supplied to a function that takes formal parameters - UnexpectedArgument { + UnexpectedArgumentFormals { arg: NixString, formals_span: Span, }, @@ -487,7 +487,7 @@ to a missing value in the attribute set(s) included via `with`."#, write!(f, "Error converting TOML to a Nix value: {msg}") } - ErrorKind::UnexpectedArgument { arg, .. } => { + ErrorKind::UnexpectedArgumentFormals { arg, .. } => { write!(f, "Unexpected argument `{arg}` supplied to function",) } @@ -778,7 +778,7 @@ impl Error { ErrorKind::DuplicateAttrsKey { .. } => "in this attribute set", ErrorKind::InvalidAttributeName(_) => "in this attribute set", ErrorKind::RelativePathResolution(_) => "in this path literal", - ErrorKind::UnexpectedArgument { .. } => "in this function call", + ErrorKind::UnexpectedArgumentFormals { .. } => "in this function call", ErrorKind::UnexpectedContext => "in this string", // The spans for some errors don't have any more descriptive stuff @@ -853,7 +853,7 @@ impl Error { ErrorKind::ImportCompilerError { .. } => "E028", ErrorKind::IO { .. } => "E029", ErrorKind::JsonError { .. } => "E030", - ErrorKind::UnexpectedArgument { .. } => "E031", + ErrorKind::UnexpectedArgumentFormals { .. } => "E031", ErrorKind::RelativePathResolution(_) => "E032", ErrorKind::DivisionByZero => "E033", ErrorKind::FromTomlError(_) => "E035", @@ -898,7 +898,7 @@ impl Error { spans_for_parse_errors(&file, errors) } - ErrorKind::UnexpectedArgument { formals_span, .. } => { + ErrorKind::UnexpectedArgumentFormals { formals_span, .. } => { vec![ SpanLabel { label: self.span_label(), diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs index 1fa9eba4bc5f..48dcdfc8df47 100644 --- a/tvix/eval/src/vm/mod.rs +++ b/tvix/eval/src/vm/mod.rs @@ -797,7 +797,7 @@ where if !formals.contains(arg) { return frame.error( self, - ErrorKind::UnexpectedArgument { + ErrorKind::UnexpectedArgumentFormals { arg: arg.clone(), formals_span: formals.span, }, |