`when` should change the scope so you can call fun...
# language-proposals
b
when
should change the scope so you can call functions on the parameter. Like, I wish
when
was declared like:
Copy code
fun <T, R> when(target: T, block: T.()->R): R
So you could use it like:
Copy code
return when(str) {
    equals("foo") -> foo()
    contains("bar") -> baz()
}
👍 1
👎 5