aboutsummaryrefslogtreecommitdiff
path: root/src/type/check.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-22 23:48:35 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-22 23:48:35 +0300
commit12a7cbf8ef911f0cbfcbd13d1c888025fa411de4 (patch)
tree9f76d6676cb6d27ab6966e4a7bbe325d744de31c /src/type/check.rs
parent16e1791ea6c404b16c9c9353333e887a75d9d427 (diff)
downloadmyslip-12a7cbf8ef911f0cbfcbd13d1c888025fa411de4.tar.gz
myslip-12a7cbf8ef911f0cbfcbd13d1c888025fa411de4.zip
fix: added missing conversions and generic inferring for coproducts
Diffstat (limited to 'src/type/check.rs')
-rw-r--r--src/type/check.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/type/check.rs b/src/type/check.rs
index 5ccd0e7..bb88efb 100644
--- a/src/type/check.rs
+++ b/src/type/check.rs
@@ -510,6 +510,14 @@ impl Type {
Ok(r1)
},
+ (SumType(a1, a2), SumType(b1, b2)) => {
+ let mut r1 = a1.infer_generics_ctx(b1, ctx.clone())?;
+ let r2 = a2.infer_generics_ctx(b2, ctx.clone())?;
+ r1.extend_from_slice(&r2);
+ r1.extend_from_slice(&ctx);
+ Ok(r1)
+ },
+
(List(v1), List(v2)) => {
let mut res = ctx.clone();
for (t1, t2) in v1.into_iter().zip(v2.into_iter()) {