gabrielfv
08/28/2018, 7:46 PMprivate val dashItemInterface: DashItemInterface = object : DashItemInterface {
override fun onClick(item: DashItem) {
item.foo()
}
}
The IDE suggests to convert it to a lambda, however when I set it like that:
private val dashItemInferface: DashItemInterface = { item: DashItem -> item.foo() }
It signals as a type mismatch, saying it was expecting an instance of an implementation of the interface rather than a (DashItem) -> Unit
. Am I doing it wrong somehow?Dominaezzz
08/28/2018, 7:49 PMprivate val dashItemInferface = DashItemInterface { it.foo() }
.gabrielfv
08/28/2018, 7:50 PM