I have a language/syntax question, I stumbled on it in Android...
I was looking at some code that read:
supportFragmentManager.commit {
...
}
When I see this pattern, I think "trailing closure syntax". On closer examination, I realized that
this
in said closure-esque body wasn't what I thought it was, so I went and found the method signature for FragmentManager.commit...
FragmentManager.commit(allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit
I know that () -> Unit is a nullary closure, but what does it mean when I see the above? ClassName.() -> Unit?