1) Do not inline in function declared as "inline"

2) Evaluate all arguments except lambdas
This commit is contained in:
Konstantin Anisimov
2017-11-30 17:52:19 +03:00
committed by KonstantinAnisimov
parent 9ca5f835f5
commit 53b243c9f8
3 changed files with 64 additions and 22 deletions
@@ -0,0 +1,13 @@
package codegen.inline.inline26
import kotlin.test.*
inline fun call(block1: () -> Unit, noinline block2: () -> Int): Int {
block1()
return block2()
}
@Test fun runTest() {
var x = 5
println(call({ x = 7 }, x::toInt))
}