Skip to content

Commit

Permalink
Added test for untested nested annotation restriction.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulp committed Jan 26, 2013
1 parent 76bb23d commit e626ecd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/files/neg/nested-annotation.check
@@ -0,0 +1,10 @@
nested-annotation.scala:3: warning: Implementation restriction: subclassing Classfile does not
make your annotation visible at runtime. If that is what
you want, you must write the annotation class in Java.
class ComplexAnnotation(val value: Annotation) extends ClassfileAnnotation
^
nested-annotation.scala:8: error: nested classfile annotations must be defined in java; found: inline
@ComplexAnnotation(new inline) def bippy(): Int = 1
^
one warning found
one error found
9 changes: 9 additions & 0 deletions test/files/neg/nested-annotation.scala
@@ -0,0 +1,9 @@
import annotation._

class ComplexAnnotation(val value: Annotation) extends ClassfileAnnotation

class A {
// It's hard to induce this error because @ComplexAnnotation(@inline) is a parse
// error so it never gets out of the parser, but:
@ComplexAnnotation(new inline) def bippy(): Int = 1
}

0 comments on commit e626ecd

Please sign in to comment.