From 7cb3ec77c50a1dc71e128c0767b2cfda5dedb41f Mon Sep 17 00:00:00 2001 From: jekky <11986158+jac3km4@users.noreply.github.com> Date: Mon, 28 Nov 2022 00:12:20 +0000 Subject: [PATCH] fix: make is_same_shape work for primitives --- compiler/src/typer.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/typer.rs b/compiler/src/typer.rs index 9a762581..f1253082 100644 --- a/compiler/src/typer.rs +++ b/compiler/src/typer.rs @@ -1083,11 +1083,11 @@ impl<'id> Mono<'id> { (Self::Bottom, _) | (_, Type::Top | Type::Var(_)) => true, (Self::Prim(lhs), Type::Prim(rhs)) => lhs == rhs, (Self::Data(lhs), Type::Data(rhs)) if lhs.id == rhs.id => true, - (Self::Data(lhs), Type::Data(rhs)) => { - match (lhs.id.ref_type(), &lhs.args[..], rhs.id.ref_type(), &rhs.args[..]) { - (Some(_), [lhs], Some(_), [rhs]) => lhs.is_same_shape(rhs), - (Some(_), [lhs], None, _) => lhs.is_same_shape(typ), - (None, _, Some(_), [rhs]) => self.is_same_shape(rhs), + (lhs, Type::Data(rhs)) => { + match (lhs.ref_type(), rhs.id.ref_type(), &rhs.args[..]) { + (Some((_, lhs)), Some(_), [rhs]) => lhs.is_same_shape(rhs), + (Some((_, lhs)), None, _) => lhs.is_same_shape(typ), + (None, Some(_), [rhs]) => self.is_same_shape(rhs), _ => false, } }