class A
class B
inline def f(v: String)(using a: A) = v
inline def f(v: String)(using b: B) = v.reverse
def t =
given b: B = new B()
f("hello")
I’m getting the error
Ambiguous overload. The overloaded alternatives of method f with types
(v: String)(using b: B): String
(v: String)(using a: A): String
both match arguments (("hello" : String))
Is there a way to ignore function overloads which can not satisfy the using constraint at the call site? Or a different way to achieve a similar pattern?
My use case is inspired by the builder pattern with contextual functions.