refactor: make functions non-semantic types #13

Merged
gk1623 merged 2 commits from remove-func-type into master 2025-02-07 14:12:59 +00:00
5 changed files with 90 additions and 92 deletions
Showing only changes of commit 4e10fb3fda - Show all commits

View File

@@ -203,7 +203,6 @@ object typeChecker {
) match { ) match {
case what @ KnownType.Pair(left, _) => case what @ KnownType.Pair(left, _) =>
left.satisfies(constraint, elem.pos) left.satisfies(constraint, elem.pos)
case ? => ?.satisfies(constraint, elem.pos)
case _ => ctx.error(Error.InternalError(elem.pos, "fst must be applied to a pair")) case _ => ctx.error(Error.InternalError(elem.pos, "fst must be applied to a pair"))
} // satisfies constraint } // satisfies constraint
case Snd(elem) => case Snd(elem) =>
@@ -212,7 +211,6 @@ object typeChecker {
Constraint.Is(KnownType.Pair(?, ?), "snd must be applied to a pair") Constraint.Is(KnownType.Pair(?, ?), "snd must be applied to a pair")
) match { ) match {
case KnownType.Pair(_, right) => right.satisfies(constraint, elem.pos) case KnownType.Pair(_, right) => right.satisfies(constraint, elem.pos)
case ? => ?.satisfies(constraint, elem.pos)
case _ => ctx.error(Error.InternalError(elem.pos, "snd must be applied to a pair")) case _ => ctx.error(Error.InternalError(elem.pos, "snd must be applied to a pair"))
} }