fun foo(body: (Int) -> Unit) = body(1) fun test() { foo { val x = ~it + 1 val xx = it + 2 foo { val y = it - 1 val yy = it - 2 } val xxx = it + 3 } }