msiegenthaler/pusca — Issue #5: @impure on a method prevents tailrec optimization
Author: msiegenthaler
Created: 2011-12-03 16:08:49+00:00
State: open

Example:
@impure @annotation.tailrec private def fanOut(to: List[Actor[String]], l: String): Unit = to match {
case a :: r ⇒
handleAction(Send(a, l))
fanOut(r, l)
case Nil ⇒ ()
}

Probably due to addSideEffect added.

Proposed solution: Remove all calls addSideEffect/applySideEffect late in compilation (but before the optimization stages)