JVM_IR KT-47984 allow noinline functional inplace args
This commit is contained in:
committed by
TeamCityServer
parent
9be941def2
commit
7a99f9ff2e
@@ -0,0 +1,30 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
|
||||
val z = ArrayList<String>()
|
||||
|
||||
inline fun a(body: () -> Unit) {
|
||||
body()
|
||||
z += "a"
|
||||
}
|
||||
|
||||
inline fun b(body: () -> Unit) {
|
||||
z += "b"
|
||||
body()
|
||||
a { z += "from b" }
|
||||
}
|
||||
|
||||
fun test() {
|
||||
b { z += "test" }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test()
|
||||
|
||||
if (z != listOf("b", "test", "from b", "a"))
|
||||
return z.toString()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 1 ASTORE 1
|
||||
// 12 ALOAD 1
|
||||
// JVM_TEMPLATES
|
||||
// 2 ASTORE 1
|
||||
// 13 ALOAD 1
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
fun box(): String {
|
||||
val seq = buildSequence {
|
||||
yield("O")
|
||||
yield("K")
|
||||
}
|
||||
val it = seq.iterator()
|
||||
return it.next() + it.next()
|
||||
}
|
||||
Reference in New Issue
Block a user