Skip to content
Snippets Groups Projects
Commit 9f64c5f0 authored by Regis Blanc's avatar Regis Blanc
Browse files

fix with typed fun invocation

parent f956f924
No related branches found
No related tags found
No related merge requests found
...@@ -164,7 +164,7 @@ object AntiAliasingPhase extends TransformationPhase { ...@@ -164,7 +164,7 @@ object AntiAliasingPhase extends TransformationPhase {
updatedFunDefs.get(fd.fd) match { updatedFunDefs.get(fd.fd) match {
case None => (None, bindings) case None => (None, bindings)
case Some(nfd) => { case Some(nfd) => {
val nfi = FunctionInvocation(nfd.typed, args).setPos(fi) val nfi = FunctionInvocation(nfd.typed(fd.tps), args).setPos(fi)
val fiEffects = effects.getOrElse(fd.fd, Set()) val fiEffects = effects.getOrElse(fd.fd, Set())
if(fiEffects.nonEmpty) { if(fiEffects.nonEmpty) {
val modifiedArgs: Seq[Variable] = val modifiedArgs: Seq[Variable] =
...@@ -267,7 +267,9 @@ object AntiAliasingPhase extends TransformationPhase { ...@@ -267,7 +267,9 @@ object AntiAliasingPhase extends TransformationPhase {
if(!effects.isDefinedAt(fi.tfd.fd)) { if(!effects.isDefinedAt(fi.tfd.fd)) {
println("fi not defined: " + fi) println("fi not defined: " + fi)
} }
val mutatedParams: Set[Int] = effects(fi.tfd.fd) //TODO: the require should be fine once we consider nested functions as well
//require(effects.isDefinedAt(fi.tfd.fd)
val mutatedParams: Set[Int] = effects.get(fi.tfd.fd).getOrElse(Set())
fi.args.zipWithIndex.flatMap{ fi.args.zipWithIndex.flatMap{
case (Variable(id), i) if mutatedParams.contains(i) => Some(id) case (Variable(id), i) if mutatedParams.contains(i) => Some(id)
case _ => None case _ => None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment