Take a look at this code:
var counter: () -> Int = { -42 }
fun reinitializeCounter(): Int {
var value = 0
counter = { ++value }
return value
}
What does the reinitializeCounter function return if you call it and don't call the counter at the same time?