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:
@@ -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>()
|
||||
Reference in New Issue
Block a user