refactor: fail on ?
snd or fst type-check result
This commit is contained in:
parent
f143f685c4
commit
4e10fb3fda
@ -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"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user