Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for untested nested annotation restriction.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |