Kotlin has class and property delegation. I wonder if it makes sense to also have function delegation. For example, imagine a Facade that for some functions, simply delegates it’s exposed public function to something else:
class Facade(
private val delegate:Delegate
) {
fun aaa(a,b,c,d) by delegate::bbb
}
class Delegate {
fun bbb(a,b,c,d) { ... }
}
If the number of arguments or functions increases, doing it manually like
fun aaa(a,b,c,d,e,f) = delegate.bbb(a,b,c,d,e,f)
becomes tedious. This seems useful if a class needs to delegate to another class, only a subset of some interface, or does not want to implement the whole interface via class delegation.