Hey guys! Sorry for asking maybe a stupid question...
# getting-started
c
Hey guys! Sorry for asking maybe a stupid question, but I'm migrating a personal project to Kotlin and I'm trying to figure out if I can, in a generic way, include the dagger component's
inject
as an extension function from the class that is to be Injected. I'm thinking of something like this
Copy code
abstract class Injectable <T : SomeBaseComponent> {
    
    abstract fun T.inject(activity: Injectable)
    
}
but the more I think about it, 1. the less sense it makes to be possible to do (especially when you're adding a method to an existing interface) 2. making the
T
method abstract makes the class abstract (??) 3. I would actually want sublasses of
Injectable
to be passed, not the bass class itself. Anything that can be done close to that maybe? ­čĄö