I have an interface in kotlin, which looks something like this
interface BaseDao<in M : Model> {
...
@Delete
fun delete(models: Collection<M>)
...
}
Now when I look at the generated code I see something like this:
public interface BaseDao {
...
@Delete
void delete(@NotNull Collection var1);
...
}
Is there a way to tell kotlin that I want the type of the collection explicitly set?
The 'generated code' is actually compiled byte-code decompiled to Java. And since generic types are lost due to type erasure, you will see plain Collection.
When working with the code from Java, the function still enforces the correct types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With