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:
committed by
Space Team
parent
5cd817955b
commit
b262070922
+22
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user