title: How to solve ambiguous reference to overloaded definition in scala
body: <p>I am getting the following error in scala:</p>
  
  <pre><code>ambiguous reference to overloaded definition,
  both method register in trait Configurable of type (x$1: Any, x$2: &lt;repeated...&gt;[Class[_]])javax.ws.rs.client.Client
  and  method register in trait Configurable of type (x$1: Any) javax.ws.rs.client.Client
  match argument types (Object)
  
  [ERROR]     client.register(ClientFilter.getFilter().asInstanceOf[Object])
  </code></pre>
  
  <p>Shouldn't asInstance[Object] inform the compiler which version  of jersey client register to use?  Here's the code:</p>
  
  <pre><code>val client: Client =
        ClientBuilder.newBuilder()
          .build();
   client.register(ClientFilter.getFilter().asInstanceOf[Object])
  </code></pre>
  
  <p>ClientFilter.getFilter() is an instance of ClientRequestFilter</p>