Reputation: 1580
I am getting the following error in scala:
ambiguous reference to overloaded definition,
both method register in trait Configurable of type (x$1: Any, x$2: <repeated...>[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])
Shouldn't asInstance[Object] inform the compiler which version of jersey client register to use? Here's the code:
val client: Client =
ClientBuilder.newBuilder()
.build();
client.register(ClientFilter.getFilter().asInstanceOf[Object])
ClientFilter.getFilter() is an instance of ClientRequestFilter
Upvotes: 5
Views: 2668
Reputation: 39577
You'll need a Java class to do the dispatch for you, due to this issue not getting resolved in favor of my PR, which added -Yno-java-tupling
to do what you expect. Hopefully the workarounds will be temporary, and won't be necessary once overload resolution precedes autotupling, as described in a comment on the ticket.
Upvotes: 3