I have this function that (theoretically) accept an array of functions as argument.
fun execute(afterDay: Long, listeners: Array<(List<String>) -> Unit>)
In the client class I trying to call this execute method and pass functions as parameter:
fun updateMovies(ids: Array<String>){
}
fun getNewIds() {
GetImdbIds(kodein).execute(daysBack.toEpochDay(), [::updateMovies])
}
But it doesn't compiles.
What I'm doing wrong?
the error:
Error:(29, 59) Kotlin: Type inference failed. Expected type mismatch: inferred type is Array<KFunction1<@ParameterName Array<String>, Unit>> but Array<(List<String>) -> Unit> was expected
Error:(29, 59) Kotlin: Unsupported [Collection literals outside of annotations]