KT-13440 Bound callable references in reflection

This commit is contained in:
Dmitry Petrov
2016-11-23 18:54:58 +03:00
parent 5879e201cd
commit 3d2696c81b
33 changed files with 1276 additions and 70 deletions
@@ -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"
}