use thiserror::Error;
use crate::{ConstString, compilation::CompilationError, execution::ExecutionError};
#[derive(Error, Debug)]
pub enum Error {
#[error("compilation error: {0}")]
Compilation(#[from] CompilationError),
#[error("execution error: {0}")]
Execution(#[from] ExecutionError),
#[error("enum variant {name} already exists with value {old} new value: {new}")]
DuplicateVariant {
name: ConstString,
old: i8,
new: i8,
},
#[error("conversion of value {value} into {into} is not possible")]
TryConversion {
value: ConstString,
into: ConstString,
},
}
#[cfg(test)]
mod tests {
use super::*;
const fn is_normal<T: Sized + Send + Sync>() {}
#[test]
const fn normal_types() {
is_normal::<&Error>();
is_normal::<Error>();
}
}