Actually, looking at this whole approach here I think it is currently broken.
The problem is that, in order to support the `rule ~> CaseClassCompanion` notation, we need a way to figure our the arity of the argument function *without* accessing `fun.vparams` or `fun.tpe`, because in the companion object case we don't have a `Function` in the tree. We only see the `Ident` and cannot access the `apply` method on the companion object here that the compiler will resolve to in a later phase.

For example, in the `Ops4` case we need to be able to tell these two `apply` calls apart:

    def apply[R](f: (C, D) ⇒ R)...
    def apply[R](f: (B, C, D) ⇒ R)...

They both have the same `$e` and `$ts` here, so given a `$f` of a simple `Ident`, which one do we choose?

We need logic here that determines the arity of the argument function *without* matching `$f` against anything!
Luckily there is a way to do it: By inspecting `$g` here we should be able to do it.
Can you try a `$g` based approach?