I want to pass one or more function(s) to a function but as long as it is a function literal or a package function it's working but when I change it to a function of a specific class (member function) I have the following problems
suppose I have these two functions
fun foo() { //doSomething }
fun bar(function: () -> Unit) {
//anotherThing!
function()
}
when I call
bar(foo())
or
bar(::foo)
I've encountered a type mismatch (Required: ()->Unit , Found: Unit)
Note: I don't want to solve it like this
bar( { foo() } )
or
bar {
foo()
}
