Created
October 17, 2013 17:30
-
-
Save alivesay/7028958 to your computer and use it in GitHub Desktop.
Sup with scala field annotations?
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
| Welcome to Scala version 2.10.0-20121205-235900-18481cef9b (OpenJDK 64-Bit Server VM, Java 1.7.0_40). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> class MyAnno extends scala.annotation.StaticAnnotation | |
| defined class MyAnno | |
| scala> case class Foo(@(MyAnno @scala.annotation.meta.field) x:Int) | |
| defined class Foo | |
| scala> classOf[Foo].getDeclaredFields.map(_.getAnnotations) | |
| res0: Array[Array[java.lang.annotation.Annotation]] = Array(Array()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment