diff options
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index d8d4664..b489cd1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,7 @@ use crate::vm::{Op, Value}; #[derive(Debug, Clone)] pub enum ErrorKind { TypeError(Op, Vec<Type>), + ExternTypeMismatch(String, Vec<Type>), RuntimeTypeError(Op, Vec<Value>), Assert, InvalidProgram, @@ -36,6 +37,9 @@ impl fmt::Display for ErrorKind { .fold(String::new(), |a, v| { format!("{}{:?}, ", a, v) }); write!(f, "{} Cannot apply {:?} to types {}", "Type Error".bold(), op, types) } + ErrorKind::ExternTypeMismatch(name, types) => { + write!(f, "{} Extern function '{}' doesn't accept argument(s) with type(s) {:?}", "Type Error".bold(), name, types) + } ErrorKind::RuntimeTypeError(op, values) => { let values = values .iter() |
