-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Erasure in 5.1.11 #218
Comments
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: |
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:
The text was updated successfully, but these errors were encountered: