aboutsummaryrefslogtreecommitdiff
path: root/src/type/display.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-21 12:35:37 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-21 12:35:37 +0300
commitd1c97e405230b6616ef834cf38be351e566a228e (patch)
tree7c75d9353b0b3cc9f08400c5d09e0b7552afc9c8 /src/type/display.rs
parenta70dcaa949f41c585f9aea5e79f2550053d8e857 (diff)
downloadmyslip-d1c97e405230b6616ef834cf38be351e566a228e.tar.gz
myslip-d1c97e405230b6616ef834cf38be351e566a228e.zip
feat: implemented coproducts according to tests
Diffstat (limited to 'src/type/display.rs')
-rw-r--r--src/type/display.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/type/display.rs b/src/type/display.rs
index 99394df..586483c 100644
--- a/src/type/display.rs
+++ b/src/type/display.rs
@@ -119,12 +119,17 @@ impl fmt::Display for TypeError {
letexp
)
},
- DifferentTypeCaseArms(ty1, ty2) => write!(f, "arms of match have different types, '{ty1}' and '{ty2}'"),
- FunAsAtom => write!(f, "'fn' used as atom doesn't make sense"),
+ DifferentTypeCaseArms(ty1, ty2)
+ => write!(f, "arms of match have different types, '{ty1}' and '{ty2}'"),
+ FunAsAtom => write!(f, "'fn' used as atom doesn't make sense"),
CaseAsAtom => write!(f, "'case' used as atom doesn't make sense"),
RestAsAtom => write!(f, "'..[name]' used as atom doesn't make sense"),
- InvalidFunDef(exp, err) => write!(f, "invalid function definition '{exp}': {err}"),
- NoWildcardInCase(exp) => write!(f, "no wildcard in cases: '{exp}'"),
+ InvalidFunDef(exp, err)
+ => write!(f, "invalid function definition '{exp}': {err}"),
+ NoWildcardInCase(exp)
+ => write!(f, "no wildcard in cases: '{exp}'"),
+ SumDefNoTypeLiteral(exp)
+ => write!(f, "other arm of coproduct should've been a type in {exp}"),
OtherError => write!(f, "uncategorized error"),
}
}