diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-13 00:35:45 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-13 00:35:45 -0700 |
commit | f25713b50dadb3104980450fd61473e063d0b829 (patch) | |
tree | 045dea18ffa44342aa079cf5abbdc1e19b162a38 /src | |
parent | 758f0a7ac5366c9748739032383456b6e7727d37 (diff) | |
parent | 21f14e371c0baa9d59678fe5645cea80586ef116 (diff) | |
download | scala-f25713b50dadb3104980450fd61473e063d0b829.tar.gz scala-f25713b50dadb3104980450fd61473e063d0b829.tar.bz2 scala-f25713b50dadb3104980450fd61473e063d0b829.zip |
Merge pull request #891 from lrytz/t5975
SI-5957 enable direct parsing of nested java class classfile
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index e6499c05a6..60e11291c1 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -645,7 +645,14 @@ abstract class ClassfileParser { // if this is a non-static inner class, remove the explicit outer parameter val newParams = innerClasses.get(currentClass) match { case Some(entry) if !isScalaRaw && !isStatic(entry.jflags) => - assert(params.head.tpe.typeSymbol == clazz.owner, params.head.tpe.typeSymbol + ": " + clazz.owner) + /* About `clazz.owner.isPackage` below: SI-5957 + * For every nested java class A$B, there are two symbols in the scala compiler. + * 1. created by SymbolLoader, because of the existence of the A$B.class file, owner: package + * 2. created by ClassfileParser of A when reading the inner classes, owner: A + * If symbol 1 gets completed (e.g. because the compiled source mentions `A$B`, not `A#B`), the + * ClassfileParser for 1 executes, and clazz.owner is the package. + */ + assert(params.head.tpe.typeSymbol == clazz.owner || clazz.owner.isPackage, params.head.tpe.typeSymbol + ": " + clazz.owner) params.tail case _ => params |