Files
kotlin-fork/compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/generic.kt
T
Mads Ager 6622846bc1 [JVM IR] Do not put destructuring params or underscores in LVT.
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.

Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
2021-11-02 15:13:14 +03:00

25 lines
849 B
Kotlin
Vendored

// WITH_RUNTIME
data class A<T, F>(val x: T, val y: F)
suspend fun <X, Y> foo(a: A<X, Y>, block: suspend (A<X, Y>) -> String) = block(a)
suspend fun test() = foo(A("OK", 1)) { (x_param, y_param) ->
x_param + (y_param.toString())
}
// METHOD : GenericKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
// JVM_TEMPLATES
// VARIABLE : NAME=$dstr$x_param$y_param TYPE=LA; INDEX=2
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
// VARIABLE : NAME=y_param TYPE=I INDEX=4
// VARIABLE : NAME=this TYPE=LGenericKt$test$2; INDEX=0
// VARIABLE : NAME=$result TYPE=Ljava/lang/Object; INDEX=1
// JVM_IR_TEMPLATES
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
// VARIABLE : NAME=y_param TYPE=I INDEX=4
// VARIABLE : NAME=this TYPE=LGenericKt$test$2; INDEX=0
// VARIABLE : NAME=$result TYPE=Ljava/lang/Object; INDEX=1