Issue with higher order function as a binding adapter

后端 未结 4 668
野的像风
野的像风 2021-02-07 10:09

I am running into issues trying to take a function as a parameter in a binding adapter using Kotlin/Android databinding. This example code throws e: error: cannot generate

4条回答
  •  一整个雨季
    2021-02-07 10:32

    The declaration () -> Unit suggests a function which takes no input and returns nothing (Unit is the return type in this statement). Your function should look like this:

    fun testFunction() = {}
    

提交回复
热议问题