Support reflection tests on Android

This commit is contained in:
Mikhael Bogdanov
2019-01-22 17:48:45 +01:00
parent 91980c5293
commit f2a51d3b80
49 changed files with 235 additions and 174 deletions
@@ -3,6 +3,8 @@
// FULL_JDK
// WITH_REFLECT
package test
annotation class Anno(val value: String)
interface Test {
@@ -10,7 +12,7 @@ interface Test {
}
fun box(): String {
val testMethod = Class.forName("Test\$DefaultImpls").declaredMethods.single()
val testMethod = Class.forName("test.Test\$DefaultImpls").declaredMethods.single()
//return (::test.parameters.single().annotations.single() as Simple).value
val receiverAnnotations = (testMethod.parameters[0]).annotations
if (receiverAnnotations.isNotEmpty()) return "fail: receiver parameter should not have any annotations, but: ${receiverAnnotations.joinToString()}"