rocketraman
11/11/2016, 3:08 PM?:
be evaluated on an argument of an infix function call, or on the call's result? From general:
>>> val m = mutableMapOf<String, String>()
>>> "a" to m["b"] ?: "was null"
(a, null)
>>> "a" to (m["b"] ?: "was null")
(a, was null)
I wasn't expecting the first result. Perhaps I should have but it seemed obvious to me that the ?: "was null"
would be applied to m["b"]
and not "a" to m["b"]
. The response on #general was that the first result was obvious, but is it?