Just curious on how I would go about doing an exte...
# announcements
a
Just curious on how I would go about doing an extension that is overriding a class/object. If it's the only thing I'm looking to do with a class but I can't make a subclass of it because of the way that it's used in a library so I can't just do that without doing a bunch of hacks to do it like in java
r
There are no ways of doing this. Extension functions are translated to static methods receiving
this
as first argument. You won't get your extension function into virtual method hierarchy from outside of inheritance tree.
a
Yeah I had a feeling. Maybe there should be a more efficient way of doing so
r
There is still bytecode weaving if this is a necessity for you, but I'd avoid that if I can.
a
Yeah I'm just gonna have to do it the conventional way. But thanks anyways.