Okay, Something has been bothering me for a few da...
# announcements
a
Okay, Something has been bothering me for a few days now. I'm wondering If Kotlin could develop features (specially in the JVM) in the future or not. Could we add a Interface to a class with an extension? For example we have a class
Test
(that is in a library) and we don't have access to it's code, and we have a interface like
Killer
, Can we make
Test
implement
Killer
with an extension? this way wherever
Test
is used, we have access to
Killer
functions. The solution in my head is that Kotlin can do this by creating a
Test$Killer
class that extends
Test
and replace
Test
with
Test$Killer
everywhere in the code. But this only works for open classes. This can be done for final classes in Swift, and I'm wondering if that could be done without modifying the bytecode.