Greg Rynkowski
01/26/2022, 10:16 AM// all T - java classes implementing ViewDataBinding, each providing a static `bind` method
// ViewDataBinding - a Java abstract class (with no declaration of `bind`)
interface BindingAware<T : ViewDataBinding> {
var f: T
fun bind(v: View) {
// f = T.bind(a) // <= how to call static method provided by class behind T?
}
}
How to call static method of T, having only T?Rob Elliot
01/26/2022, 10:32 AMViewDataBinding
.
But even if bind
were an instance method, if it wasn't defined on ViewDataBinding
then it would be purely convention that all subclasses of ViewDataBinding
had one, not something the static type checker could rely on and prove.
I see this is an Android class - might be worth asking in #android or even #android-databinding how people have solved what you are trying to do?