diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-15 10:48:23 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-20 21:24:59 +0200 |
commit | 48c2d7bebb6ac41a897e58bd991cfa06818c7d71 (patch) | |
tree | 33a35ec2ba3bf6b7d37deb8359dc57858b302c0c /test/files/jvm/innerClassAttribute/Test.scala | |
parent | 6df88b024f720a10d3f7451750ab620addf725b9 (diff) | |
download | scala-48c2d7bebb6ac41a897e58bd991cfa06818c7d71.tar.gz scala-48c2d7bebb6ac41a897e58bd991cfa06818c7d71.tar.bz2 scala-48c2d7bebb6ac41a897e58bd991cfa06818c7d71.zip |
Simplify and correctify calculation of the InnerClass attribute
The InnerClass attribute needs to contain an entry for every nested
class that is defined or referenced in a class. Details are in a
doc comment in BTypes.scala.
Instead of collecting ClassBTypes of nested classes into a hash map
during code generation, traverse the class before writing it out to
disk. The previous approach was incorrect as soon as the generated
bytecode was modified by the optimzier (DCE, inlining).
Fixes https://github.com/scala/scala-dev/issues/21.
Diffstat (limited to 'test/files/jvm/innerClassAttribute/Test.scala')
-rw-r--r-- | test/files/jvm/innerClassAttribute/Test.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala index 702e5e279a..903d08f72d 100644 --- a/test/files/jvm/innerClassAttribute/Test.scala +++ b/test/files/jvm/innerClassAttribute/Test.scala @@ -23,7 +23,7 @@ object Test extends BytecodeTest { def testInner(cls: String, fs: (InnerClassNode => Unit)*) = { val ns = innerClassNodes(cls) - assert(ns.length == fs.length, ns) + assert(ns.length == fs.length, ns.map(_.name)) (ns zip fs.toList) foreach { case (n, f) => f(n) } } |