Reputation: 3706
I'd like to be able to do this
fun <A> doSomething(block: A.Companion.() -> Unit): Unit {
// bla bla bla
A.block()
}
Is it possible? If not? Is it in the roadmap?
Upvotes: 0
Views: 248
Reputation: 874
No, your example is impossible and not in roadmap.
Not all classes have companion objects and there are no ability to check if the specific class has.
Upvotes: 1