Files
kotlin-fork/compiler/testData/codegen/boxInline/reified/kt15956.kt
T
2020-03-12 17:22:33 +03:00

24 lines
415 B
Kotlin
Vendored

// FILE: 1.kt
// WITH_REFLECT
// IGNORE_BACKEND: JS, JS_IR
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>()
}