summaryrefslogtreecommitdiff
path: root/test/files/jvm/innerClassAttribute/Test.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-07-15 19:59:57 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-07-22 09:21:21 +0200
commit77b8b6a11fbcb067160052a54b9d777593787fb5 (patch)
treeb80d9a7f6860c1973bb09994d1c2546c03dfe4c0 /test/files/jvm/innerClassAttribute/Test.scala
parentf55bdbff0ba20a4fb3805e27b4b01752f45bc490 (diff)
downloadscala-77b8b6a11fbcb067160052a54b9d777593787fb5.tar.gz
scala-77b8b6a11fbcb067160052a54b9d777593787fb5.tar.bz2
scala-77b8b6a11fbcb067160052a54b9d777593787fb5.zip
SI-9393 fix modifiers of ClassBTypes for Java annotations
The Scala classfile and java source parsers make Java annotation classes (which are actually interfaces at the classfile level) look like Scala annotation classes: - the INTERFACE / ABSTRACT flags are not added - scala.annotation.Annotation is added as superclass - scala.annotation.ClassfileAnnotation is added as interface This makes type-checking @Annot uniform, whether it is defined in Java or Scala. This is a hack that leads to various bugs (SI-9393, SI-9400). Instead the type-checking should be special-cased for Java annotations. This commit fixes SI-9393 and a part of SI-9400, but it's still easy to generate invalid classfiles. Restores the assertions that were disabled in #4621. I'd like to leave these assertions in: they are valuable and helped uncovering the issue being fixed here. A new flag JAVA_ANNOTATION is introduced for Java annotation ClassSymbols, similar to the existing ENUM flag. When building ClassBTypes for Java annotations, the flags, superclass and interfaces are recovered to represent the situation in the classfile. Cleans up and documents the flags space in the area of "late" and "anti" flags. The test for SI-9393 is extended to test both the classfile and the java source parser.
Diffstat (limited to 'test/files/jvm/innerClassAttribute/Test.scala')
-rw-r--r--test/files/jvm/innerClassAttribute/Test.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala
index ca50beae7f..702e5e279a 100644
--- a/test/files/jvm/innerClassAttribute/Test.scala
+++ b/test/files/jvm/innerClassAttribute/Test.scala
@@ -145,9 +145,7 @@ object Test extends BytecodeTest {
def testA11() = {
val List(ann) = innerClassNodes("A11")
- // in the java class file, the INNERCLASS attribute has more flags (public | static | abstract | interface | annotation)
- // the scala compiler has its own interpretation of java annotations ant their flags.. it only emits publicStatic.
- assertMember(ann, "JavaAnnot_1", "Ann", flags = publicStatic)
+ assertMember(ann, "JavaAnnot_1", "Ann", flags = publicAbstractInterface | Flags.ACC_STATIC | Flags.ACC_ANNOTATION)
}
def testA13() = {