Fix subElim rule, Fix type insert

This commit is contained in:
JanUlrich 2022-04-16 15:54:36 +02:00
parent 93af1d12f6
commit 37ae27a521
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ object InsertTypes {
case UnifyTV(n) => {
val to = solvedCons.find(_.left == x).get
to match {
case UnifyEqualsDot(UnifyTV(_), UnifyTV(x)) => this.sigma(UnifyTV(x))
case UnifyEqualsDot(UnifyTV(_), UnifyTV(x)) => GenericType(x)
case UnifyEqualsDot(UnifyTV(_), UnifyRefType(n, ps)) => RefType(n, ps.map(this.sigma(_)))
case UnifyLessDot(UnifyTV(x), UnifyRefType(n, ps)) => GenericType(x)
}

View File

@ -51,7 +51,7 @@ object Unify {
case UnifyLessDot(UnifyTV(a), UnifyTV(b)) => true
case _ => false
}).map(it => {
subst(it.left.asInstanceOf[UnifyTV], it.right, ret) ++ Set(UnifyEqualsDot(it.right, it.left))
subst(it.left.asInstanceOf[UnifyTV], it.right, ret.filter(it != _)) ++ Set(UnifyEqualsDot(it.left, it.right), UnifyEqualsDot(it.right, it.right))
})
}