Generate annotations from descriptors, not PSI

This commit is contained in:
Andrey Breslav
2014-12-22 17:24:07 +03:00
parent 830e4dfd98
commit 8ff5cf62cc
5 changed files with 31 additions and 56 deletions
@@ -0,0 +1,11 @@
package a
import java.lang.annotation.*
Retention(RetentionPolicy.RUNTIME)
annotation class Ann
trait Tr {
Ann
fun foo() {}
}
@@ -0,0 +1,9 @@
class C : a.Tr
fun main(args: Array<String>) {
val method = javaClass<C>().getDeclaredMethod("foo")
val annotations = method.getDeclaredAnnotations().joinToString("\n")
if (annotations != "@a.Ann()") {
throw AssertionError(annotations)
}
}