From c60d55adba298313245cff91aac9dcac72381292 Mon Sep 17 00:00:00 2001 From: Michael Sippel <micha@fragmental.art> Date: Tue, 25 Feb 2025 22:56:12 +0100 Subject: [PATCH] subtype unification: dont allow trait types as subtypes --- src/unification.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/unification.rs b/src/unification.rs index e605af4..850d76c 100644 --- a/src/unification.rs +++ b/src/unification.rs @@ -92,16 +92,19 @@ impl UnificationProblem { }, (t, TypeTerm::Ladder(mut a1)) => { - if let Ok(mut halo) = self.eval_subtype( t.clone(), a1.first().unwrap().clone(), addr.clone() ) { + /* + if let Ok(mut halo) = self.eval_subtype( t.clone(), a1.first().unwrap().clone(), addr.clone() ) a1.append(&mut halo); Ok(a1) } else { + */ Err(UnificationError{ addr, t1: t, t2: TypeTerm::Ladder(a1) }) - } + //} } (TypeTerm::Ladder(mut a1), t) => { if let Ok(mut halo) = self.eval_subtype( a1.pop().unwrap(), t.clone(), addr.clone() ) { + a1.append(&mut halo); Ok(a1) } else {