JVM IR: Copy type parameters from outer class to suspendImpl

Previously we copied only type parameters from containing class, but we
need to do that for outer classes as well.
 #KT-55125
This commit is contained in:
Ilmir Usmanov
2023-02-07 16:01:10 +01:00
committed by Space Team
parent 5cd817955b
commit b262070922
5 changed files with 38 additions and 2 deletions
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// FULL_JDK
class Outer<U> {
inner abstract class AbstractPersistence<T> {
open suspend fun fetch(identifier: U): T? = null
}
fun foo(): String = AbstractPersistence::class.java.declaredMethods
.single { it.name.contains("\$suspendImpl") }
.toGenericString()
}
fun box(): String {
val genericString = Outer<Unit>().foo()
if (!genericString.startsWith("static <T,U>")) {
return genericString
}
return "OK"
}