Additional tests on reflection calls
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
open class A {
|
||||
fun foo() = "OK"
|
||||
}
|
||||
|
||||
class B : A()
|
||||
|
||||
fun box(): String {
|
||||
val foo = B::class.members.single { it.name == "foo" }
|
||||
return foo.call(B()) as String
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
open class A<T>(val t: T) {
|
||||
fun foo() = t
|
||||
}
|
||||
|
||||
class B(s: String) : A<String>(s)
|
||||
|
||||
fun box(): String {
|
||||
val foo = B::class.members.single { it.name == "foo" }
|
||||
return foo.call(B("OK")) as String
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
class Local {
|
||||
fun result(s: String) = s
|
||||
}
|
||||
|
||||
return Local::result.call(Local(), "OK")
|
||||
}
|
||||
Reference in New Issue
Block a user