diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-12 20:00:56 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-12 20:00:56 +0300 |
commit | a8a4c5b567ea6a58809dc8232ea5f1d3c93879b9 (patch) | |
tree | d9ed2fc0970900bb4b8ff790158ae3ff3c0213d9 /src/type/mod.rs | |
parent | db736d795b759edd913d96195747f0881c4e950f (diff) | |
download | myslip-a8a4c5b567ea6a58809dc8232ea5f1d3c93879b9.tar.gz myslip-a8a4c5b567ea6a58809dc8232ea5f1d3c93879b9.zip |
feat: type checking for case expressions
Diffstat (limited to 'src/type/mod.rs')
-rw-r--r-- | src/type/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/type/mod.rs b/src/type/mod.rs index 34506d0..e979595 100644 --- a/src/type/mod.rs +++ b/src/type/mod.rs @@ -71,8 +71,14 @@ pub enum TypeError { FunAsAtom, + CaseAsAtom, + + RestAsAtom, + InvalidFunDef(SExp, FunDefError), + NoWildcardInCase(SExp), + OtherError } @@ -93,6 +99,8 @@ pub enum FunDefError { #[derive(Debug,PartialEq)] pub enum PatFail { RepeatedVariable(String, SExp), + NoArm(SExp), + RestNotAtEnd(SExp), TypeMismatch { pattern: SExp, expected: Type, |