Kapt: add some JeElement tests
(cherry picked from commit 948a4b6)
This commit is contained in:
committed by
Yan Zhulanow
parent
0fc92c784b
commit
927280f7ce
@@ -0,0 +1,31 @@
|
||||
// test.Main
|
||||
|
||||
package test
|
||||
|
||||
@MainAnno("A", 5)
|
||||
class Main {
|
||||
@field:XAnno(color = Color.GREEN)
|
||||
val x: String
|
||||
|
||||
@get:YAnno(arrayOf<String>("Mary", "Tom"), intArrayOf(1, 3, 5), arrayOf<Color>(Color.GREEN, Color.RED))
|
||||
val y: String
|
||||
|
||||
@set:ZAnno(String::class, arrayOf(String::class, Long::class, Main::class))
|
||||
var z: String
|
||||
|
||||
// Property annotations are lost here (we don't create Elements (javac API) for the synthetic propertyName$annotations() methods)
|
||||
@MainAnno("B", 6)
|
||||
val zz: String
|
||||
}
|
||||
|
||||
enum class Color {
|
||||
RED, GREEN, BLUE
|
||||
}
|
||||
|
||||
annotation class MainAnno(val a: String, val b: Int)
|
||||
|
||||
annotation class XAnno(val color: Color)
|
||||
|
||||
annotation class YAnno(val names: Array<String>, val ints: Array<Int>, val colors: Array<Color>)
|
||||
|
||||
annotation class ZAnno(val clazz: Class<*>, val classes = Array<Class<*>>)
|
||||
Reference in New Issue
Block a user