by grdvnl · 13y ago · 0 comments
scala> for (y<-x if x > 2)
| println(y)
<console>:9: error: value > is not a member of Array[Int]
for (y<-x if x > 2)
^
As you suggested, there may be a idiomatically better way to get implicit inference and also use the filters. I would be glad if some one corrects me on that.Edit: Yeah, I see the silly error I made. I'll better get some sleep. I will leave this comment intact, for the responses to make sense.
for (y <- x if y > 2) ...I see that the recently released IDEA 12 has a similar feature (but so far incomplete and undocumented according to their bug tracker).