Files
kotlin-fork/compiler/testData/codegen/boxInline/reified/kt15956.kt
T
2021-02-02 17:53:52 +03:00

27 lines
471 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS, JS_IR
// WITH_REFLECT
// FILE: 1.kt
package foo
import kotlin.reflect.full.primaryConstructor
inline fun <reified T : Any> f(): String {
var result = ""
for (p in T::class.primaryConstructor!!.parameters.sortedBy { it.index }) {
result += p.name
}
return result
}
// FILE: 2.kt
import foo.*
class A(val O: Int, val K: Int)
fun box(): String {
return f<A>()
}