Created
August 13, 2012 15:25
-
-
Save crimsoncor/3341825 to your computer and use it in GitHub Desktop.
scala.annotation.target annotations break scalabeans
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
package test | |
import scala.annotation.target.field | |
import Thing._ | |
import javax.xml.bind.annotation.XmlAnyAttribute | |
import org.scalastuff.scalabeans.types.ScalaType | |
import org.scalastuff.scalabeans.sig.{Mirror, ClassDeclExtractor} | |
import org.scalastuff.scalabeans.PropertyDescriptor | |
import org.scalastuff.scalabeans.Preamble._ | |
object ScalaBeanTest { | |
def main(args: Array[String]): Unit = { | |
val clazz = classOf[Thing] | |
clazz.getDeclaredFields.foreach{ f => | |
println("Field: " + f.getName) | |
f.getAnnotations.foreach(a => println("ANNOT: " + a.annotationType)) | |
} | |
val scalaType = scalaTypeOf(clazz) | |
val t = ClassDeclExtractor.extract(scalaType.erasure) | |
} | |
} | |
class Thing(@XAA val arg1: Int) | |
{} | |
object Thing{ | |
type XAA = XmlAnyAttribute @field //Comment out @field annotation and it works. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment