The kotlin method with a string and a listener parameter (similar to closing in fast).
fun testA(str: String, listner: (lstr: String) -> Void) {
}
A call of this type.
testA("hello") { lstr ->
print(lstr)
}
Error: The type of invalid mismatch type is Unit, but Void is expected to be
Which unit? Return return type Void
. Read a lot of other questions, but you can find out what's happening here with this simple method.
source
share