Open dotta opened 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)) }
Getting the same error for the following expression. What would be the workaround in this case? (other than using map )
map
for( x <- Range(1, 5) ) yield { x }
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: