JVM_IR: do not deep-copy suspend lambdas in initializers

This loses reflection metadata (and also sometimes fails). Which was
missing anyway - this is also fixed now.

 #KT-42554 Fixed
This commit is contained in:
pyos
2020-10-08 20:37:21 +02:00
committed by Alexander Udalov
parent 8bc7370b92
commit e6c0575d3a
8 changed files with 47 additions and 13 deletions
@@ -0,0 +1,12 @@
// TARGET_BACKEND: JVM
// WITH_REFLECT
import kotlin.reflect.jvm.reflect
class C {
val x: suspend (String) -> Unit = { OK: String -> }
}
fun box(): String {
return C().x.reflect()?.parameters?.singleOrNull()?.name ?: "null"
}