Skip to content

Instantly share code, notes, and snippets.

@crimsoncor
Created August 13, 2012 15:25
Show Gist options
  • Save crimsoncor/3341825 to your computer and use it in GitHub Desktop.
Save crimsoncor/3341825 to your computer and use it in GitHub Desktop.
scala.annotation.target annotations break scalabeans
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