1) Do not inline in function declared as "inline"
2) Evaluate all arguments except lambdas
This commit is contained in:
committed by
KonstantinAnisimov
parent
9ca5f835f5
commit
53b243c9f8
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user