use thiserror::Error;
#[derive(Clone, Debug, Error)]
pub enum UnrollError {
#[error("placeholder with index {placeholder} cannot be instantiated using only {args_len} arguments")]
ArgMissing {
placeholder: usize,
args_len: usize,
},
#[error("placeholder in position that expects type {placeholder_ty}, but got argument of type {arg_ty}")]
InvalidType {
placeholder_ty: &'static str,
arg_ty: &'static str,
},
#[error(
"unrolling expression evaluated to {args_len} expressions, but expected {expected_len}"
)]
UnexpectedLength {
expected_len: usize,
args_len: usize,
},
#[error("array access with {args_len} indexes, but expected {expected_len} indexes")]
UnexpectedIndexes {
expected_len: usize,
args_len: usize,
},
#[error("unknown identifier {0}")]
UnknownIdentifier(String),
}