https://kotlinlang.org logo
#announcements
Title
# announcements
b

bbaldino

07/17/2019, 7:51 PM
maybe this is a dumb question: can i create an instance of a private inner class from the outer class? i'm getting a runtime error about
java.lang.VerifyError: Call to wrong <init> method
my setup looks roughly like this:``` abstract class MapEventKeyFilterHandler<T, U { private val mapEventHandler: MapEventHandler<T, U> by lazy { this.MapHandler() } private inner class MapHandler : MapEventHandler<T, U> { ... ```
i've been playing around with different ways of instantiating
mapEventHandler
, thinking perhaps assigning it directly was having issues, but the error has been the same
i'm trying to implement an adapter of sorts: this abstract class bridges one interface (implemented by the inner class) to an interface it defines. i didn't want the top-level abstract class to implement the "from" interface (
MapEventHandler
in this case) as i want the user of it to only see the "to" interface it defines (via the abstract methods)
ok, it looks like this isn't a fundamental issue, but something that's being hit when running unit tests when it tries to call
Class.forName
3 Views