refactor: change typo in Unweakenable
This commit is contained in:
parent
9da2744cb9
commit
84932edb69
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user