But I get this cryptic error from the compilerThe problem is that you're asking too much of Scala's type inference. It's trying to figure out the type parameter it needs for doFoo[?](number), and while it's pretty clear to us as humans that it has to be F given the context...
