I have an example where recently we needed to subclass akka.persistence.AbstractPersistentActorWithAtLeastOnceDelivery
This abstract class has a few things going on, of which also includes scala traits. I get the following error when trying to compile a kotlin class that inherits from it.
class OurPersistentActor : AbstractPersistentActorWithAtLeastOnceDelivery()
The compile error is…
Error:(53, 1) Kotlin: Class ‘OurPersistentActor’ must be declared abstract or implement abstract base class member public abstract fun akka$persistence$AtLeastOnceDeliveryLike$$unconfirmed_$eq(p0: SortedMap<Any!, Delivery!>!): Unit defined in akka.persistence.AbstractPersistentActorWithAtLeastOnceDelivery
Using this base class from Java compiles fine though.
class OurPersistentActor : AbstractPersistentActorWithAtLeastOnceDelivery() {
override fun receiveCommand(): PartialFunction<Any, BoxedUnit> {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun receiveRecover(): PartialFunction<Any, BoxedUnit> {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
Sorry should have been more specific. I’ve tried both Kotlin 1.1.1 as well as 1.1.2 with no differences. The version of akka that we are using is 2.5.1.
akka_version = ‘2.5.1’
compile “com.typesafe.akka:akka-actor_2.12:$akka_version”
compile “com.typesafe.akka:akka-cluster-tools_2.12:$akka_version”
compile “com.typesafe.akka:akka-cluster-sharding_2.12:$akka_version”
compile “com.typesafe.akka:akka-persistence_2.12:$akka_version”
compile “com.typesafe.akka:akka-persistence-query_2.12:$akka_version”