diff options
author | mihaylov <mihaylov@epfl.ch> | 2007-06-27 20:01:01 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2007-06-27 20:01:01 +0000 |
commit | eea125fb1d82edc9a1d50125c65345958c50f5d8 (patch) | |
tree | fa4f8bffc51ffec39a6fe9ba5e408d1fcc9c25a5 /test/files/jvm5/annotations.scala | |
parent | 088d4aef3fd8cd33a32b907335e7c6d71cd0ca58 (diff) | |
download | scala-eea125fb1d82edc9a1d50125c65345958c50f5d8.tar.gz scala-eea125fb1d82edc9a1d50125c65345958c50f5d8.tar.bz2 scala-eea125fb1d82edc9a1d50125c65345958c50f5d8.zip |
(Hopefully) made test/files/jvm5/annotations.sc...
(Hopefully) made test/files/jvm5/annotations.scala JVM-independant
Diffstat (limited to 'test/files/jvm5/annotations.scala')
-rw-r--r-- | test/files/jvm5/annotations.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/jvm5/annotations.scala b/test/files/jvm5/annotations.scala index 9d755a71c0..5c4d3ec996 100644 --- a/test/files/jvm5/annotations.scala +++ b/test/files/jvm5/annotations.scala @@ -77,9 +77,21 @@ object Test4 { class Foo4 { @SourceAnnotation("file:///dev/null") val x = 1 + } + class Foo5 { @SourceAnnotation("file:///dev/zero") def bar: Int = 0 } + class Foo6 @SourceAnnotation("primary constructor")(s: String) { + // to guarantee that primary constructor annotations + // are not applied to secondary constructors + def this() = this("") + } + class Foo7(s: String) { + @SourceAnnotation("secondary constructor") + def this() = this("") + } + class Foo8(@SourceAnnotation("constructor val") val n: Int) {} def run { import java.lang.annotation.Annotation import java.lang.reflect.AnnotatedElement @@ -103,6 +115,11 @@ object Test4 { printSourceAnnotations(classOf[Foo3]) classOf[Foo4].getDeclaredFields foreach printSourceAnnotations classOf[Foo4].getDeclaredMethods foreach printSourceAnnotations + classOf[Foo5].getDeclaredMethods foreach printSourceAnnotations + classOf[Foo6].getDeclaredConstructors foreach printSourceAnnotations + classOf[Foo7].getDeclaredConstructors foreach printSourceAnnotations + classOf[Foo8].getDeclaredFields foreach printSourceAnnotations + classOf[Foo8].getDeclaredMethods foreach printSourceAnnotations } } |