Hi, what is the syntax for passing a function from...
# announcements
s
Hi, what is the syntax for passing a function from a companion object as a parameter? Let’s say I have
fun doSomething(provider: () -> Fragment)
and inside
MainFragment
Copy code
companion object {
  fun newInstance() = MainFragment()
}
doSomething(::MainFragment.newInstance)
unfortunately doesn’t work 😞