Why this is not working:
List(true,false).filter(_).size
The error says:
:8: error: missing parameter type f
The first error is because Scala doesn't know what to make of _. So try this...
List(true,false).filter(_:Boolean).size
After that, you get more info:
:8: error: type mismatch;
found : Boolean
required: (Boolean) => Boolean
List(true,false).filter(_:Boolean).size
It's just evaluating the _ just as the value and not as function. Per the ScalaDoc
filter (pred: (A) ⇒ Boolean): GenTraversable[A]