bbaldino
07/17/2019, 6:27 AMclass Foo<T> {
...
inner interface FooEventHandler {
fun event(value: T)
}
}
but it looks like this isn't possible (it says inner
can't be used with interface
). is there a good way to accomplish something like this? i don't want the user to have to define the generic type in 2 places (once for Foo and once for instantiating a FooEventHandler, because it could only lead to a mistake)karelpeeters
07/17/2019, 7:51 AMinner class
means instances of the class always store a reference to the base class, and of course that isn't possible with interfaces. You'll have to repeat the generic argument.bbaldino
07/17/2019, 3:38 PM