aboutsummaryrefslogtreecommitdiff
path: root/src/type/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/type/mod.rs')
-rw-r--r--src/type/mod.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/type/mod.rs b/src/type/mod.rs
index f08dc1a..34506d0 100644
--- a/src/type/mod.rs
+++ b/src/type/mod.rs
@@ -5,6 +5,7 @@ pub mod display;
pub mod check;
pub mod subst;
pub mod conversion;
+pub mod case;
use crate::sexp::SExp;
@@ -59,6 +60,8 @@ pub enum TypeError {
found: Type,
},
+ InvalidPattern(PatFail),
+
ArgumentsDontMatchGeneric {
argtype: Type,
generictype: Type,
@@ -73,6 +76,7 @@ pub enum TypeError {
OtherError
}
+
#[derive(Debug,PartialEq)]
pub enum FunDefError {
NoFunToken,
@@ -85,6 +89,18 @@ pub enum FunDefError {
InvalidReturnType,
}
+
+#[derive(Debug,PartialEq)]
+pub enum PatFail {
+ RepeatedVariable(String, SExp),
+ TypeMismatch {
+ pattern: SExp,
+ expected: Type,
+ found: Type,
+ }
+}
+
+
use Type::*;
impl Type {