f507a26a12
Unlike ordinary lambdas, suspend lambdas do the computation in doResume(Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object; method. As you can see, there are no decomposed parameters. As a result, they used not to be generated. To fix the issue, I add decomposed parameters to value parameters while generating local variables table. In addition, when generating suspend lambda for inline, the codegen does not take this kind of parameters into account. This is also fixed. #KT-18576: Fixed
27 lines
953 B
Kotlin
Vendored
27 lines
953 B
Kotlin
Vendored
class A<T>(val x: String, val y: String, val z: T)
|
|
|
|
suspend fun <T> foo(a: A<T>, block: suspend (A<T>) -> String): String = block(a)
|
|
|
|
operator fun A<*>.component1() = x
|
|
|
|
object B {
|
|
operator fun A<*>.component2() = y
|
|
}
|
|
|
|
suspend fun B.bar(): String {
|
|
operator fun <R> A<R>.component3() = z
|
|
|
|
return foo(A("O", "K", 123)) { (x_param, y_param, z_param) -> x_param + y_param + z_param.toString() }
|
|
}
|
|
|
|
suspend fun test() = B.bar()
|
|
|
|
// METHOD : ExtensionComponentsKt$bar$3.doResume(Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
|
|
// VARIABLE : NAME=this TYPE=LExtensionComponentsKt$bar$3; INDEX=0
|
|
// VARIABLE : NAME=data TYPE=Ljava/lang/Object; INDEX=1
|
|
// VARIABLE : NAME=throwable TYPE=Ljava/lang/Throwable; INDEX=2
|
|
// VARIABLE : NAME=$x_param_y_param_z_param TYPE=LA; INDEX=3
|
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=4
|
|
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=5
|
|
// VARIABLE : NAME=z_param TYPE=I INDEX=6
|