about summary refs log tree commit diff
path: root/users/aspen/achilles/src/interpreter/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/aspen/achilles/src/interpreter/error.rs')
-rw-r--r--users/aspen/achilles/src/interpreter/error.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/users/aspen/achilles/src/interpreter/error.rs b/users/aspen/achilles/src/interpreter/error.rs
new file mode 100644
index 0000000000..268d6f479a
--- /dev/null
+++ b/users/aspen/achilles/src/interpreter/error.rs
@@ -0,0 +1,19 @@
+use std::result;
+
+use thiserror::Error;
+
+use crate::ast::{Ident, Type};
+
+#[derive(Debug, PartialEq, Eq, Error)]
+pub enum Error {
+    #[error("Undefined variable {0}")]
+    UndefinedVariable(Ident<'static>),
+
+    #[error("Unexpected type {actual}, expected type {expected}")]
+    InvalidType {
+        actual: Type<'static>,
+        expected: Type<'static>,
+    },
+}
+
+pub type Result<T> = result::Result<T, Error>;