Last active
October 30, 2016 11:00
-
-
Save h0tk3y/cb178ea938bdcfc78bc772755c49c0d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Uses Kotlin 1.0.4 with kotlin-reflect | |
| fun main(args: Array<String>) { | |
| val p = C::x | |
| println(p.javaGetter!!.annotations.toList()) | |
| println(p.javaField!!.annotations.toList()) | |
| } | |
| @Target(AnnotationTarget.FIELD) | |
| annotation class MyAnnotation | |
| class C { | |
| @MyAnnotation | |
| val x: Int = 0 | |
| } | |
| // Output: | |
| // [] | |
| // [@MyAnnotation()] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment