Skip to content
Snippets Groups Projects
Commit 786bb219 authored by Mario Bucev's avatar Mario Bucev
Browse files

Adding a case for type instantiation

parent 1c8c0bac
No related branches found
No related tags found
1 merge request!184Adding a case for type instantiation
Pipeline #160624 failed
......@@ -72,6 +72,15 @@ trait TypeOps {
(ts1 zip ts2).foldLeft[Instantiation](Map.empty) {
case (inst, (tp1, tp2)) => unify(inst, rec(tp1, tp2))
}
case (adt1: ADTType, refn: RefinementType) =>
refn.getType match {
case adt2: ADTType =>
// ADT(X1, ..., Xn) -> { vd: ADT(A1, ..., An) | prop }
// ~>
// X1 -> A1, ..., Xn -> An
rec(adt1, adt2)
case _ => throw new Failure
}
case _ => throw new Failure
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment