From 84932edb693574d0f1f2481ca3059043d4ca9b11 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Fri, 7 Feb 2025 18:43:30 +0000 Subject: [PATCH] refactor: change typo in Unweakenable --- src/main/wacc/typeChecker.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/wacc/typeChecker.scala b/src/main/wacc/typeChecker.scala index 6168480..62fad3b 100644 --- a/src/main/wacc/typeChecker.scala +++ b/src/main/wacc/typeChecker.scala @@ -28,7 +28,7 @@ object typeChecker { // Allows weakening in both directions, useful for array literals case IsSymmetricCompatible(ty: SemType, msg: String) // Does not allow weakening - case IsUnweakanable(ty: SemType, msg: String) + case IsUnweakenable(ty: SemType, msg: String) case IsEither(ty1: SemType, ty2: SemType, msg: String) case Never(msg: String) } @@ -57,8 +57,8 @@ object typeChecker { KnownType.String case (ty, Constraint.IsSymmetricCompatible(ty2, msg)) => ty.satisfies(Constraint.Is(ty2, msg), pos) - // Change to IsUnweakanable to disallow recursive weakening - case (ty, Constraint.Is(ty2, msg)) => ty.satisfies(Constraint.IsUnweakanable(ty2, msg), pos) + // Change to IsUnweakenable to disallow recursive weakening + case (ty, Constraint.Is(ty2, msg)) => ty.satisfies(Constraint.IsUnweakenable(ty2, msg), pos) case (ty, Constraint.Unconstrained) => ty case (ty, Constraint.Never(msg)) => ctx.error(Error.SemanticError(pos, msg)) @@ -66,7 +66,7 @@ object typeChecker { (ty moreSpecific ty1).orElse(ty moreSpecific ty2).getOrElse { ctx.error(Error.TypeMismatch(pos, ty1, ty, msg)) } - case (ty, Constraint.IsUnweakanable(ty2, msg)) => + case (ty, Constraint.IsUnweakenable(ty2, msg)) => (ty moreSpecific ty2).getOrElse { ctx.error(Error.TypeMismatch(pos, ty2, ty, msg)) }