diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-01-29 10:29:33 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-01-29 10:29:33 +1000 |
commit | 8b334459d0e09cf486b12ea6869ddc2f2a9eb6a6 (patch) | |
tree | 9b91ee264a8a4abf936b4b2c939591decb751313 /test/files/jvm | |
parent | 020581e795a677b838fa62f67064fe9a55b02ba0 (diff) | |
parent | 7b5998a0592ee707c02a13859fe1520687c76c38 (diff) | |
download | scala-8b334459d0e09cf486b12ea6869ddc2f2a9eb6a6.tar.gz scala-8b334459d0e09cf486b12ea6869ddc2f2a9eb6a6.tar.bz2 scala-8b334459d0e09cf486b12ea6869ddc2f2a9eb6a6.zip |
Merge remote-tracking branch 'origin/2.11.x' into merge/2.11.x-to-2.12.x-20150129
Conflicts:
build.number
src/library/scala/concurrent/Future.scala
versions.properties
Diffstat (limited to 'test/files/jvm')
-rw-r--r-- | test/files/jvm/innerClassAttribute/Test.scala | 29 | ||||
-rw-r--r-- | test/files/jvm/t8582.check | 6 | ||||
-rw-r--r-- | test/files/jvm/t8582.scala | 4 | ||||
-rw-r--r-- | test/files/jvm/t9044.scala | 6 |
4 files changed, 25 insertions, 20 deletions
diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala index 1c1a0522e4..3820048cb4 100644 --- a/test/files/jvm/innerClassAttribute/Test.scala +++ b/test/files/jvm/innerClassAttribute/Test.scala @@ -84,17 +84,15 @@ object Test extends BytecodeTest { } def testA3() = { - def t(c: String) = { - val List(b1, b2) = innerClassNodes(c) - // the outer class for classes nested inside top-level modules is not the module class, but the mirror class. - // this is a hack for java interop, handled in the backend. see BTypes.scala, comment on "Java Compatibility". - assertMember(b1, "A3", "B1", flags = publicStatic) - assertMember(b2, "A3", "B2$", flags = publicStatic) - } - t("A3$") - // the mirror class has the same inner class attributes as the module - // class (added when the mirror is created in the backend) - t("A3") + // the inner class entries for top-level object members are in the companion class, so nothing in the module class + val List() = innerClassNodes("A3$") + + // inner class entries in the companion class (a backend-generated mirror class in this case) + val List(b1, b2) = innerClassNodes("A3") + // the outer class for classes nested inside top-level modules is not the module class, but the mirror class. + // this is a hack for java interop, handled in the backend. see BTypes.scala, comment on "Java Compatibility". + assertMember(b1, "A3", "B1", flags = publicStatic) + assertMember(b2, "A3", "B2$", flags = publicStatic) } def testA4() = { @@ -164,7 +162,10 @@ object Test extends BytecodeTest { } def testA15() = { - val List(b) = innerClassNodes("A15") + // no member classes, only anonymous / local. these are nested in the module class, not the companion. + val List() = innerClassNodes("A15") + + val List(b) = innerClassNodes("A15$") assertLocal(b, "A15$B$3", "B$3") val List(_, c) = innerClassNodes("A15$B$3") @@ -283,9 +284,7 @@ object Test extends BytecodeTest { assertMember(i3c, "A21", "I3$", flags = publicStatic) assertLocal(j1, "A21$J1$1", "J1$1") - val List(i2m, i3m, j3, j4, j5) = innerClassNodes("A21$") - assertMember(i2m, "A21", "I2", flags = publicStatic) - assertMember(i3m, "A21", "I3$", flags = publicStatic) + val List(j3, j4, j5) = innerClassNodes("A21$") assertLocal(j3, "A21$J3$1", "J3$1") assertLocal(j4, "A21$J4$1", "J4$1") assertLocal(j5, "A21$J5$1", "J5$1") // non-static! diff --git a/test/files/jvm/t8582.check b/test/files/jvm/t8582.check index 1d19f1d6a8..0e4da90398 100644 --- a/test/files/jvm/t8582.check +++ b/test/files/jvm/t8582.check @@ -17,10 +17,10 @@ Reflection can find direct nested classes (A2-B2-C2) 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 +The InnerClass attribute of a mirror class contains the members of the module class: className[p1/p2/Singleton$Singleton$] outerClassName[p1/p2/Singleton] innerName[Singleton$] access[9] +The module members are not in the InnerClass table of the module class (unless referenced): + An outer class has a InnerClass attribute for direct nested classes className[A1$B1] outerClassName[A1] innerName[B1] access[1] diff --git a/test/files/jvm/t8582.scala b/test/files/jvm/t8582.scala index 8a57ef7952..e9a01f9016 100644 --- a/test/files/jvm/t8582.scala +++ b/test/files/jvm/t8582.scala @@ -55,9 +55,9 @@ object Test extends BytecodeTest { println(nested(classOf[A2#B2])) println(nested(classOf[A2#B2#C2])) - nprintln("Mirror classes have the same InnerClass attributes as the corresponding module class:") + nprintln("The InnerClass attribute of a mirror class contains the members of the module class:") printInner("p1.p2.Singleton") // mirror class - println("Module class") + println("The module members are not in the InnerClass table of the module class (unless referenced):") printInner("p1.p2.Singleton$") nprintln("An outer class has a InnerClass attribute for direct nested classes") diff --git a/test/files/jvm/t9044.scala b/test/files/jvm/t9044.scala new file mode 100644 index 0000000000..b1073325e8 --- /dev/null +++ b/test/files/jvm/t9044.scala @@ -0,0 +1,6 @@ +trait A +trait B +object Test extends A with B with App { + val is = Test.getClass.getInterfaces.mkString(", ") + assert(is == "interface A, interface B, interface scala.App", is) +} |