scala-ide / scala-worksheet

A Scala IDE plugin for a multi-line REPL (called worksheet)
96 stars 24 forks source link

Wrong instrumentation for HOF using infix notation #107

Open dotta opened 11 years ago

dotta commented 11 years ago
object error {
  List(0) map { el =>
    List(el)
  }
}

The above worksheet fails compiling, and the error recursive value res$0 needs type is reported.

The workaround is to not use the infix notation, i.e., the following works just fine:

object error {
  List(0).map { el =>
    List(el)
  }                                               //> res0: List[List[Int]] = List(List(0))
}
dipakc commented 11 years ago

Getting the same error for the following expression. What would be the workaround in this case? (other than using map )

for( x <- Range(1, 5) ) yield {
  x
}