paulblessing
02/05/2016, 6:30 PMclass GenericClass<T> where T : Interface, T : Interface2 {
fun doSomethingWithT(t: T) {
t.interfaceMethod()
t.interface2Method()
}
companion object {
private val instance: GenericClass<*> = ???
fun <T> getAnInstance(): GenericClass<T> where T : Interface, T : Interface2 {
return instance as GenericClass<T>
}
}
}