JVM_IR: generate instance fields even when reification is needed

The inliner supports that, we just need to generate the reification
markers on GETFIELD to instance fields.
This commit is contained in:
pyos
2021-07-05 13:44:22 +02:00
committed by max-kammerer
parent c01c356817
commit a15a5aa429
17 changed files with 146 additions and 96 deletions
@@ -0,0 +1,18 @@
// CHECK_BYTECODE_LISTING
// FILE: 1.kt
package test
inline fun <reified U> bar() = U::class.simpleName!!
inline fun <reified T> foo(): String {
val x = { bar<Array<T>>() }
return x()
}
// FILE: 2.kt
import test.*
fun box(): String {
val result = foo<Int>()
return if (result == "Array") "OK" else result
}