You need to make an implicit witness for the everywhere combinator available in the body of your method,
def traverseAndManipulate[B](expr: B)
(implicit e: Everywhere[manipulate.type, B]) = everywhere(manipulate)(expr)
Note that for reasons that I'm not able to fathom just at the moment, giving traverseAndManipulate
an explicit result type of B
causes the compiler to report a similar ambiguity. The result type is however correctly inferred as B
. If you prefer to have an explicit result type, the following should be equivalent,
def traverseAndManipulate[B](expr: B)
(implicit e: Everywhere[manipulate.type, B] { type Result = B }): B = e(expr)