diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm5/annotations.check | 18 | ||||
-rw-r--r-- | test/files/jvm5/annotations.scala | 17 |
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 } } |