Even, I find this strange and I may be wrong. With your definition, when I use the for construct, I see this:
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.