use alloc::borrow::Cow;
use thiserror::Error;
use crate::func::args::Ownership;
#[derive(Debug, Error, PartialEq)]
pub enum ArgError {
#[error("expected `{expected}` but received `{received}` (@ argument index {index})")]
UnexpectedType {
index: usize,
expected: Cow<'static, str>,
received: Cow<'static, str>,
},
#[error("expected {expected} value but received {received} value (@ argument index {index})")]
InvalidOwnership {
index: usize,
expected: Ownership,
received: Ownership,
},
#[error("expected an argument but received none")]
EmptyArgList,
}
#[derive(Debug, Error, PartialEq)]
#[error("argument count out of bounds: {0}")]
pub struct ArgCountOutOfBoundsError(pub usize);