is there a way to avoid having to specify the type...
# announcements
k
is there a way to avoid having to specify the type parameter to
Foo
, I don't like that i have to specify the type and the class reference
Copy code
interface SomeInterface
class SomeImplementation: SomeInterface

abstract class Foo<in T : SomeInterface>(private val clazz: Class<T>){
    abstract fun foo(something: T)
}

class Bar: Foo<SomeImplementation>(SomeImplementation::class.java) {
    override fun foo(something: SomeImplementation) {
        // do something
    }
}