diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-14 21:31:21 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-16 19:43:59 +0200 |
commit | cf819b7756de917912807322259ebb993a52ce57 (patch) | |
tree | 029fda02a23ddc3051c1ec20aaeebc9dff9913c4 /test/files/run/reflection-java-annotations.scala | |
parent | 24580ac84242679619d27f20258078dd012c120a (diff) | |
download | scala-cf819b7756de917912807322259ebb993a52ce57.tar.gz scala-cf819b7756de917912807322259ebb993a52ce57.tar.bz2 scala-cf819b7756de917912807322259ebb993a52ce57.zip |
SI-6356 reflection now supports Java annotations
Except for one thingie: java enums are currently not understood
by Scala reflection, hence they aren't yet supported in annotations.
Diffstat (limited to 'test/files/run/reflection-java-annotations.scala')
-rw-r--r-- | test/files/run/reflection-java-annotations.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/reflection-java-annotations.scala b/test/files/run/reflection-java-annotations.scala new file mode 100644 index 0000000000..4a4fe2572d --- /dev/null +++ b/test/files/run/reflection-java-annotations.scala @@ -0,0 +1,20 @@ +import scala.tools.partest._ +import scala.tools.nsc.Settings + +object Test extends ReplTest { + def code = """ + import scala.reflect.runtime.universe._ + val sym = typeOf[Foo].typeSymbol + sym.typeSignature + sym.getAnnotations foreach (_.javaArgs) + println(sym.getAnnotations) + """ + + override def transformSettings(settings: Settings): Settings = { + val thisFile = testPath.jfile.getAbsolutePath + val javaCompiledAnnotationsJar = (thisFile stripSuffix "scala") + "jar" + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect"), sys.props("partest.comp"), javaCompiledAnnotationsJar) mkString sys.props("path.separator") + settings.processArguments(List("-cp", classpath), true) + settings + } +}
\ No newline at end of file |