Hi,
I tried a list with function (ki-shell 1.7.0) :
[48] val square = fun(x:Int) : Int {return x*x}
[49] val cube = fun(x:Int) : Int {return x*x*x}
[50] val l_power=mutableListOf(square, cube)
[51] l_power[0](5)
res27: Int = 25
Now with a map
[52] val m_power=mutableMapOf("power2" to square, "power3" to cube)
type results for list or map seems equal
[55] m_power["power2"](5)
ERROR Reference has a nullable type '((Int) -> Int)?', use explicit '?.invoke()' to make a function-like call instead (Line_56.kts:1:1)
But still, why does the shell print the wrong type for m_power[“power2”]? It should be a nullable type, but in the output in the OP it’s a non-nullable type.