summaryrefslogtreecommitdiff
path: root/test/files/run/t8582.check
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-05-13 12:31:26 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2014-05-13 17:40:45 +0200
commite948073ae22167082ee672d8ac21507f7b3fa9f7 (patch)
tree6d1f9c6ef2888203b846cdb9a206483f5d02648f /test/files/run/t8582.check
parentd430b03bc11c8fb279d9601fd33f5ac3ab48ed80 (diff)
downloadscala-e948073ae22167082ee672d8ac21507f7b3fa9f7.tar.gz
scala-e948073ae22167082ee672d8ac21507f7b3fa9f7.tar.bz2
scala-e948073ae22167082ee672d8ac21507f7b3fa9f7.zip
SI-8582 emit InnerClasses attribute in GenBCode
I removed the `-bcode` test since we have a build that passes `-Ybackend:GenBCode` to all tests. Short intro do the [`InnerClass` attribute][1]: - A class needs one `InnerClass` attribute for each of its nested classes - A class needs the `InnerClass` attribute for all (nested) classes that are mentioned in its constant pool The attribute for a nested class `A$B$C` consists of the long name of the outer class `A$B`, the short name of the inner class `C`, and an access flag set describig the visibility. The attribute seems to be used for reflection. [1]: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6
Diffstat (limited to 'test/files/run/t8582.check')
-rw-r--r--test/files/run/t8582.check46
1 files changed, 44 insertions, 2 deletions
diff --git a/test/files/run/t8582.check b/test/files/run/t8582.check
index 7e96756986..564f482ff8 100644
--- a/test/files/run/t8582.check
+++ b/test/files/run/t8582.check
@@ -1,2 +1,44 @@
-class p1.p2.Singleton$Singleton$
-List(class p1.p2.Singleton$Singleton$Singleton$)
+getClass on module gives module class
+ class p1.p2.Singleton$Singleton$
+
+Nested module classes are found through reflection
+ p1.p2.Singleton$Singleton$: List(class p1.p2.Singleton$Singleton$Singleton$)
+
+Reflection can find direct nested classes (A1-B1-C1)
+ A1: List(class A1$B1)
+ A1$B1: List(class A1$B1$C1)
+ A1$B1$C1: List()
+
+Reflection can find direct nested classes (A2-B2-C2)
+ A2: List(class A2$B2)
+ A2$B2: List(class A2$B2$C2)
+ A2$B2$C2: List()
+
+Mirror classes have the same InnerClass attributes as the corresponding module class:
+ className[p1/p2/Singleton$Singleton$] outerClassName[p1/p2/Singleton] innerName[Singleton$] access[9]
+Module class
+ className[p1/p2/Singleton$Singleton$] outerClassName[p1/p2/Singleton] innerName[Singleton$] access[9]
+
+An outer class has a InnerClass attribute for direct nested classes
+ className[A1$B1] outerClassName[A1] innerName[B1] access[1]
+A nested class has an InnerClass attribute for itself (and also for its nested classes)
+ className[A1$B1] outerClassName[A1] innerName[B1] access[1]
+ className[A1$B1$C1] outerClassName[A1$B1] innerName[C1] access[1]
+C1 is a nested class, so it has an InnerClass attribute for itself.
+Because that attribute leads to an entry for B1 in the constant pool, C1 needs an InnerClass attribute for B1.
+ className[A1$B1] outerClassName[A1] innerName[B1] access[1]
+ className[A1$B1$C1] outerClassName[A1$B1] innerName[C1] access[1]
+
+The BeanInfo class has the same InnerClass attributes as the corresponding bean
+ className[A1$B1] outerClassName[A1] innerName[B1] access[1]
+ className[A1$B1$C1] outerClassName[A1$B1] innerName[C1] access[1]
+
+Class A2 mentions class C2 in the constant pool (due to method f), therefore it needs an InnerClass attribute for C1
+ className[A2$B2] outerClassName[A2] innerName[B2] access[1]
+ className[A2$B2$C2] outerClassName[A2$B2] innerName[C2] access[1]
+B2
+ className[A2$B2] outerClassName[A2] innerName[B2] access[1]
+ className[A2$B2$C2] outerClassName[A2$B2] innerName[C2] access[1]
+C2
+ className[A2$B2] outerClassName[A2] innerName[B2] access[1]
+ className[A2$B2$C2] outerClassName[A2$B2] innerName[C2] access[1]