Files
kotlin-fork/compiler/testData/codegen/boxInline/reified/kt15956.kt
T
2019-05-21 07:42:16 +02:00

23 lines
386 B
Kotlin
Vendored

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