Skip to content
Snippets Groups Projects
Commit 759170bb authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Instantiate type before substituting args when inlining

parent 90bfec6d
No related branches found
No related tags found
No related merge requests found
......@@ -260,7 +260,7 @@ object TypeOps {
(LiteralPattern(newOb,lit), (ob zip newOb).toMap)
case _ =>
sys.error("woot!?")
sys.error(s"woot!? $p:$expType")
}
(srec(e), cases.map(trCase))//.copiedFrom(m)
......
......@@ -40,8 +40,8 @@ object InliningPhase extends TransformationPhase {
for (fd <- p.definedFunctions) {
fd.fullBody = simplify(preMap {
case FunctionInvocation(TypedFunDef(fd, tps), args) if doInline(fd) =>
val newBody = replaceFromIDs(fd.params.map(_.id).zip(args).toMap, fd.fullBody)
Some(instantiateType(newBody, (fd.tparams zip tps).toMap, Map()))
val newBody = instantiateType(fd.fullBody, (fd.tparams zip tps).toMap, Map())
Some(replaceFromIDs(fd.params.map(_.id).zip(args).toMap, newBody))
case _ =>
None
}(fd.fullBody))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment