Fix subElim rule, Fix type insert
This commit is contained in:
parent
93af1d12f6
commit
37ae27a521
@ -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)
|
||||
}
|
||||
|
@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user