KT-13440 Bound callable references in reflection
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
// WITH_REFLECT
|
||||
import kotlin.reflect.KParameter
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class Outer(val s1: String) {
|
||||
inner class Inner(val s2: String, val s3: String = "K") {
|
||||
val result = s1 + s2 + s3
|
||||
}
|
||||
}
|
||||
|
||||
fun KParameter.check(name: String) {
|
||||
assertEquals(name, this.name!!)
|
||||
assertEquals(KParameter.Kind.VALUE, this.kind)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val ctor = Outer("O")::Inner
|
||||
val ctorPararms = ctor.parameters
|
||||
|
||||
ctorPararms[0].check("s2")
|
||||
ctorPararms[1].check("s3")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user