A kotlin method with a string and a listener (similar to closure in swift) parameters.
fun testA(str: String, listner: (lstr: String) -> Void) {
}
Calling it like this this.
testA("hello") { lstr ->
print(lstr)
}
Error: Type mismatch inferred type is Unit but Void was expected
What's Unit?? Return type of the closure is Void
. Read lot of other questions but could find what's going on here with this simple method.