JVM_IR: propagate reified type parameter usages from inline lambdas

...to whichever class they are inlined into, not the class they are
declared in (which is not the same if the lambda is crossinline).

 #KT-46584 Fixed
This commit is contained in:
pyos
2021-05-11 16:19:20 +02:00
committed by TeamCityServer
parent e079fb665e
commit 3fc2cc410c
19 changed files with 175 additions and 45 deletions
+13
View File
@@ -0,0 +1,13 @@
// FILE: 1.kt
package test
inline fun foo(crossinline x: () -> String) = { x() }()
inline fun <reified T> bar() = foo { { T::class.simpleName!! }() }
// FILE: 2.kt
import test.*
class OK
fun box() = bar<OK>()
@@ -0,0 +1,13 @@
// FILE: 1.kt
package test
inline fun foo(x: () -> String) = x()
inline fun <reified T> bar() = { foo { { T::class.simpleName!! }() } }()
// FILE: 2.kt
import test.*
class OK
fun box() = bar<OK>()