From d1c97e405230b6616ef834cf38be351e566a228e Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Thu, 21 Aug 2025 12:35:37 +0300 Subject: feat: implemented coproducts according to tests --- src/type/display.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/type/display.rs') 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"), } } -- cgit v1.2.3