summaryrefslogtreecommitdiff
path: root/test/files/jvm5
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2007-06-27 20:01:01 +0000
committermihaylov <mihaylov@epfl.ch>2007-06-27 20:01:01 +0000
commiteea125fb1d82edc9a1d50125c65345958c50f5d8 (patch)
treefa4f8bffc51ffec39a6fe9ba5e408d1fcc9c25a5 /test/files/jvm5
parent088d4aef3fd8cd33a32b907335e7c6d71cd0ca58 (diff)
downloadscala-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')
-rw-r--r--test/files/jvm5/annotations.check18
-rw-r--r--test/files/jvm5/annotations.scala17
2 files changed, 32 insertions, 3 deletions
diff --git a/test/files/jvm5/annotations.check b/test/files/jvm5/annotations.check
index f16a1ffc0c..f01f31d1d9 100644
--- a/test/files/jvm5/annotations.check
+++ b/test/files/jvm5/annotations.check
@@ -13,11 +13,23 @@ class Test4$Foo3
@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/null)
private int Test4$Foo4.x
-@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/zero)
-public int Test4$Foo4.bar()
-
@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/null)
public int Test4$Foo4.x()
+@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/zero)
+public int Test4$Foo5.bar()
+
+@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=primary constructor)
+public Test4$Foo6(java.lang.String)
+
+@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=secondary constructor)
+public Test4$Foo7()
+
+@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=constructor val)
+private int Test4$Foo8.n
+
+@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=constructor val)
+public int Test4$Foo8.n()
+
0
99
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
}
}