Open Marcus-Rosti opened 2 years ago
Scala seems to be reducing different variable args ("String... binNames" and "Operation... ops") to the same scala "Seq" type. This causes methods to be considered duplicates of each other. I'm not sure this can be fixed on the java client side.
Can you provide scala source code that reproduces this error?
it was pretty simple to recreate, just try implementing the class in scala
class MySpike extends IAerospikeClient {
... other methods
def get(eventLoop: com.aerospike.client.async.EventLoop, listener: com.aerospike.client.listener.RecordArrayListener, policy: com.aerospike.client.policy.BatchPolicy, keys: Array[com.aerospike.client.Key], binNames: String*): Unit = ???
def get(eventLoop: com.aerospike.client.async.EventLoop, listener: com.aerospike.client.listener.RecordArrayListener, policy: com.aerospike.client.policy.BatchPolicy, keys: Array[com.aerospike.client.Key], operations: com.aerospike.client.Operation*): Unit = ???
}
IAerospikeClient is an interface and MySpike is a class. Shouldn't you be extending AerospikeClient?
right, you'd extend or implement an interface, not the class itself
To implement client methods: class MySpike implements IAerospikeClient
To extend client: class MySpike extends AerospikeClient
right, I want to implement a subset of the methods to simulate in unit tests
Scala does not directly support implementing java interfaces with method signatures that only differ by variable args. There is a workaround that is described here:
I get this error when implementing a dummy class in scala: